Fix orientation when saving/transforming JPEG images
Summary:
6597d3f35196 introduced lossless JPEG transformations including a
reset of the Exif orientation tag before saving a JPEG image.
This leads to wrongly transformed images (modified or unmodified)
if the original JPEG already had an orientation tag with a visible
transformation (not None or Normal).
This is fixed by not resetting the orientation before saving, which
keeps the original JPEG data including orientation. Only before
executing a lossless transformation the Exif orientation correction
is applied and the tag is reset.
FIXED-IN: 18.08.2
Test Plan:
- Open JPEG image with Exif orientation other than None/Normal
- Optional: Rotate/Mirror image
- File → Save or File → Save As
- Restart Gwenview to clear image cache
- The new image should have the correct orientation
Reviewers: Gwenview, ngraham
Reviewed By: Gwenview, ngraham
Subscribers: rkflx, ngraham
Tags: Gwenview
Differential Revision: https://phabricator.kde.org/D15455