-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[Peek] Expand image format support for Image Previewer #35622
Conversation
This comment has been minimized.
This comment has been minimized.
This is real fire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for the contribution!
".fff", | ||
".mef", | ||
|
||
// ".mdc", // Crashes in GetFullBitmapFromPathAsync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we should exclude this one as well... Did you test it? Couldn't find an accessable file to give it a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jaimecbernardo !
On my Windows 11 machine, ".mdc" files are not supported by BitmapDecoder
/ WIC, so this new version of Peek still won't attempt to load them via ImagePreviewer. The files' basic properties will be shown by the UnsupportedFilePreviewer instead.
I'm not sure why it was in the list originally then commented out later. I wonder if the author had the Minolta RAW plugin registered and that lit up support on their machine, but that's just a guess.
To answer your question: I've downloaded a bunch of RAW files over the last few months, but I don't have a complete set to match the full list of formats supported by Windows. (Perhaps downloading and testing them all would be a good exercise for a rainy day!). https://www.rawsamples.ch/ has some MDC file downloads, but they've never rendered for me because of them not being natively supported. I haven't had any issues with RAW images I tried with extensions which BitmapDecoder
reports as compatible.
Long story short: we don't need to explicitly exclude ".mdc" from the list!
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: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:
These were previously in the hardcoded list, but are not marked as compatible on my machine:
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:
JPEGXL (after adding system support via JXL WinThumb):
(Example JPEGXL images can be created by converting existing image files with https://squoosh.app/)
DNG (drone footage still):
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: