Review Request 122873: Fix for wrong rotation of RAW images

Martin Kyral martin.kyral at gmail.com
Tue Mar 31 12:10:09 UTC 2015



> On Bře. 13, 2015, 4:23 odp., David Edmundson wrote:
> > Do you have commit access?
> 
> Martin Kyral wrote:
>     Unfortunatelly not. I made 2 patches for gwenview so far, both committed by Aurelien on my behalf.
> 
> Martin Kyral wrote:
>     Could you, please, commit it?
> 
> Aurélien Gâteau wrote:
>     The changes done by the Qt patch do not affect only RAW images: JPEGs are not displayed correctly anymore since they rotated once by Qt and then again by Gwenview. I guess some of the special-handling code for JPEG files can simply be removed. Could you look into this?
> 
> Martin Kyral wrote:
>     It's strange, but RAW images and the previews dumped from RAW using dcraw -e are the only images affected by the double rotation. I tried removing the jpeg special-handling code unconditionally but it actually breaks the rest (I tried with the images from the gwenview tests and with images from https://github.com/recurser/exif-orientation-examples.git) so I decided to implement the fix as is in this patch. However, as I am stating in the description - the previews saved by dcraw -e (technically exactly the same data as the RAW handling code extracts) are not fixed here and this case needs to be further elaborated (probably using better detection from exif).
>     
>     It seems that there are two disctinct ways of lossless rotation of jpeg. I fiddled with some images in geeqie and gwenview with interesting results. While rotating jpeg in geeqie does not alter file size at all, rotating the same image in gwenview produces different file sizes for portrait and landscape orientation of the same image (but the file does not shrink upon multiple rotations so the data are not recompressed, thus the rotation is losless). When I rotated the image in geeqie and in gwenview I ended up with image which was displayed improperly by one of the viewers, maybe both.
>     
>     Unfortunatelly I am not familiar enough with the JPEG format nor the EXIF metadata so I am unable now to see the cause.
> 
> Aurélien Gâteau wrote:
>     My guess regarding the difference you see between Geeqie and Gwenview is that Gwenview losslessly rotates the pixels and resets the orientation flag to 1, whereas I assume Geeqie only changes the orientation flag. The way Gwenview behaves can produce weird results if the dimensions of the image are not multiples of 8, which may be the reason why your image was displayed improperly.
> 
> Martin Kyral wrote:
>     By 'displayed improperly' I meant only rotation. Thanks for explanation, thay may be it...

Could the patch be committed, please? Or are there any concerns, qestions or requests for further work on it? Thanks.


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122873/#review77427
-----------------------------------------------------------


On Bře. 13, 2015, 4:21 odp., Martin Kyral wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122873/
> -----------------------------------------------------------
> 
> (Updated Bře. 13, 2015, 4:21 odp.)
> 
> 
> Review request for Gwenview.
> 
> 
> Repository: gwenview
> 
> 
> Description
> -------
> 
> Displaying of RAW images in gwenview was broken by https://bugreports.qt.io/browse/QTBUG-37946. I am fixing (or rather workarounding it) by blocking EXIF rotation iff the loaded image is RAW.
> 
> 
> Diffs
> -----
> 
>   lib/document/loadingdocumentimpl.cpp cc8bea9 
>   lib/thumbnailprovider/thumbnailgenerator.h 4571832 
>   lib/thumbnailprovider/thumbnailgenerator.cpp 54875f5 
> 
> Diff: https://git.reviewboard.kde.org/r/122873/diff/
> 
> 
> Testing
> -------
> 
> Tested with various RAW files, used previously to test the RAW loading support itself & with some jpeg files (including https://github.com/recurser/exif-orientation-examples.git).
> 
> Seems OK.
> 
> Nevertheless, the fix is not complete as jpeg files extracted from the RAWs using 'dcraw -e' are still mis-rotated.
> 
> 
> Thanks,
> 
> Martin Kyral
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/gwenview-devel/attachments/20150331/819dc617/attachment.html>


More information about the Gwenview-devel mailing list