Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Peek] Expand image format support for Image Previewer #35622

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

daverayment
Copy link
Contributor

@daverayment daverayment commented Oct 27, 2024

Summary of the Pull Request

This removes the hardcoded list of file extensions from Peek's Image Previewer code, and instead relies upon the list returned from BitmapDecoder directly, which represents the formats the end user's system is capable of decoding.

PR Checklist

Detailed Description of the Pull Request / Additional comments

The use of GetDecoderInformationEnumerator() to get all WIC-supported formats:

  • Automatically picks up new codec support if installed on a user's system
  • Is more accurate, directly reflecting what the system can handle
  • Future-proofs the code against new image formats, i.e. we don't have to add to the list of supported extensions if Windows adds more (like HEIC etc.)

Validation Steps Performed

This was tested manually with a test folder of images in a variety of different formats, from popular filetypes like JPEG and GIF, to AVIF, cursor files, JPEGXL, and several example RAW files. I also tested with other non-image files, such as PDF, text file, MP3 and videos, to ensure the other previewers were unaffected.

Note: I don't have an example file for every supported image format.

Additions and Removals

On my Windows 11 machine, this PR adds Peek support for the following types:

.rle
.icon
.cur
.exif
.dng
.dds
.avci
.heics
.heifs
.avcs
.avifs
.PTX
.PXN
.DNG
.JXL

These were previously in the hardcoded list, but are not marked as compatible on my machine:

.jfi
.jif
.thumb
.r3d
.rwz

These may have been present on the original developer's machine when the list was curated. They should be picked up with this new code if a WIC decoder exists on the target machine for them.

Examples

Cursor:
image

JPEGXL (after adding system support via JXL WinThumb):
image

(Example JPEGXL images can be created by converting existing image files with https://squoosh.app/)

DNG (drone footage still):
image

Important Note

HEIC and JPEGXL are marked in Windows as compatible, but require separate installation. For HEIC this means paying a licence, as it is patent-encumbered. For JPEGXL, Windows support is not yet built-in, but can be added via a third party extension. If the user does not have a WIC-compatible codec installed, there will be no change from the previous version of Peek, i.e. the UnsupportedFilePreviewer will be used to show overview information of the file:

image

This comment has been minimized.

@crutkas
Copy link
Member

crutkas commented Oct 28, 2024

This is real fire

@crutkas crutkas added the Needs-Review This Pull Request awaits the review of a maintainer. label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Review This Pull Request awaits the review of a maintainer.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants