Summary: | Dolphin fails to show width/height of certain .jpg's | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Szczepan Hołyszewski <rulatir> |
Component: | general | Assignee: | Peter Penz <peter.penz19> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jos, rulatir, wstephenson |
Priority: | NOR | ||
Version: | 16.12.2 | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.5.2 | |
Sentry Crash Report: | |||
Attachments: |
No image dimensions info for this .jpg
Fixed jpegendanalyzer.cpp Cleanup: remove includes added in the process but no longer needed Diff against svn |
Forgot to set KDE version for this report, it's 4.4.95 (4.5 RC3). Btw. dolphin shows correct preview of this image, Gwenview opens it just fine etc. After further investigation it appears that this functionality is completely broken for .jpg images. The information panel shows width and height for some jpegs, fails to show it for others, and shows ***WRONG*** width and height for others yet. The latter happens sometimes when the I resize the images in place using mogrify, but at other times it causes the w&h info to disappear altogether from the information panel. SHAME! Bug still present in 4.5.1. SVN commit 1171107 by ppenz: Always read the image size of the JPEG from the header, as an available EXIF information does not assure that the image size is stored. BUG: 246854 FIXED-IN: 4.5.2 CCMAIL: jos@vandenoever.info M +44 -33 jpegendanalyzer.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1171107 NOT FIXED. Just upgraded to 4.5.2, rebooted just in case, and Dolphin ***STILL*** won't show width/height information for some jpegs, including the one I have attached to this bug report! Dolphin 1.5/KDE 4.5.2 Reopen please. Created attachment 52402 [details]
Fixed jpegendanalyzer.cpp
1) No need to dissect jpg header by hand. Use img->pixelWidth() and img->pixelHeight() - these do come from the header, not from EXIF data.
2) Never ever read pixel size from EXIF data. Jpg header should be the only source of this information, not a fallback source.
I think I finally fixed it! Please review my changes and apply if possible. Thanks for the patch! Could you please post this patch to jos@vandenoever.info for review? He is the maintainer of Strigi and decides whether the patch can go in. I'll apply the patch as soon as we got the OK from Jos. No response from Jos so far... Created attachment 52823 [details]
Cleanup: remove includes added in the process but no longer needed
Jos just wrote me back approving the fix. Please apply the cleaned-up version I just attached. Thanks Szczepan. It is very uncommon to send the whole files instead of just attaching a patch (see http://techbase.kde.org/Contribute/Send_Patches), as it makes it tricky for the developer to see what has been really changed. I wanted to check the diff of your patch, but it was very tricky as it seems your editor changed the alignments of a lot of unrelated code (so hundreds of lines haven been marked as "changed"). I then later just applied your patch locally, but it seems not to fix anything that has not been fixed already by the patch applied at http://websvn.kde.org/?view=rev&revision=1171107 (but I might have missed something). There were two problems with Jos's fix: - his code reading the jpg header failed on some jpegs - even if it succeeded, the dimensions from EXIF overrode the dimensions from the header. That wasn't right because EXIF can lie, and often does. Something as common as mogrify -resize on a jpeg with EXIF dimensions will yield a file with false information in EXIF. I was bitten by both problems while working with photos for websites. My fix removes Jos's jpeg header dissector (analyzeSize()) and uses Exiv2 API that Jos had overlooked. Furthermore it skips EXIF dimension information altogether - the jpg header is now the only source of this information, not a fallback source. Created attachment 52846 [details]
Diff against svn
Use svn diff -x -ub to suppress changes that affect only whitespace.
Thanks for the update with the diff, this makes it a lot easier :-) The patch looks good, I'll it try it during this week, will commit it to SVN and set Jos to CC. SVN commit 1189932 by ppenz: Fix issue, that the width and height of certain JPG files are not shown. The patch has been written by Szczepan Hołyszewski. CCMAIL: jos@vandenoever.info BUG: 246854 M +9 -38 jpegendanalyzer.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1189932 I've applied the patch to trunk. kdesupport does not have a separate bugfix-branch for 4.5.x like kdelibs and kdebase and AFAIK updates must be tagged manually to be available for 4.5.x. What I want to say is that I don't know for sure whether fixes like this will be available for 4.5.3 or whether this will be available for 4.6.0. |
Created attachment 49851 [details] No image dimensions info for this .jpg Version: unspecified OS: Linux For certain jpg images Dolphin fails to show width and height information in the information panel. Attaching an example of problematic image. Reproducible: Always Steps to Reproduce: Hover mouse over the problematic image. Actual Results: Width and height information should be displayed in the information panel. Expected Results: Width and height information is not displayed in the information panel.