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

Fix inability to load certain JPG files #700

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

jdpurcell
Copy link
Contributor

@jdpurcell jdpurcell commented Jul 6, 2024

Fixes #698. The code was setting setDecideFormatFromContent to true, which based on my understanding means that Qt isn't allowed to use the file's extension as a hint to pick the proper decoder. This made it scan all decoders, and the RAW decoder is claiming it can decode the file for some reason. This setting is not to be confused with setAutoDetectImageFormat which is enabled by default, so in case a file is missing an extension, it will still open properly (except for these rare cases where the auto detection gets confused), or even if it has the incorrect extension, Qt will realize that the hint provided by the filename extension is incorrect and fall back to querying all decoders.

The code enabling setDecideFormatFromContent was originally added in 97f1089 which was supposedly to fix #28, but I have no problem opening a JPG renamed as PNG even after this change, so maybe a different part of that commit was responsible for fixing it, or Qt improved their image loading since then (it works fine for me even with the legacy 5.15.2 builds by the way).

Allow the file extension to be used as a hint to give the JPG decoder priority over the RAW decoder
@jurplel jurplel merged commit be96385 into jurplel:master Oct 12, 2024
7 checks passed
@jurplel
Copy link
Owner

jurplel commented Oct 12, 2024

thank you!

@jdpurcell jdpurcell deleted the pr-issue698 branch October 16, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't display a jpeg correctly JPG files named as PNG open in other programs but not qView
2 participants