Use QImageReader's auto transform feature for JPEG images
ClosedPublic

Authored by volkov on Sep 3 2018, 10:42 AM.

Details

Summary

QImageReader can rotate JPEG images according to their
orientation since Qt 5.5.

Diff Detail

Repository
R260 Gwenview
Branch
autotransform
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2488
Build 2506: arc lint + arc unit
volkov created this revision.Sep 3 2018, 10:42 AM
Restricted Application added a project: Gwenview. · View Herald TranscriptSep 3 2018, 10:42 AM
volkov requested review of this revision.Sep 3 2018, 10:42 AM

Patch looks good to me, except for the thumbnail dimensions (see inline comment).


Independent of this patch: There's a bug when saving images with a transformation flag - the orientation is wrong in the new image (sometimes visible only after Gwenview restart).

lib/thumbnailprovider/thumbnailgenerator.cpp
181

The image dimensions are not swapped by QImageReader. If you enable ViewThumbnail DetailsImage Size in Browse Mode, the size does not match the orientation for images with e.g. ROT_90 flag. I think this switch is still needed.

Oh, thanks for testing!

volkov updated this revision to Diff 40972.Sep 4 2018, 11:38 AM

fix original image dimensions for thumbnail generator

muhlenpfordt accepted this revision.Sep 4 2018, 3:44 PM

Thanks, works flawlessly now.

lib/thumbnailprovider/thumbnailgenerator.cpp
176

Smart replacement for the switch statement. ;)

This revision is now accepted and ready to land.Sep 4 2018, 3:44 PM
volkov closed this revision.Sep 4 2018, 3:57 PM