Fix orientation when saving/transforming JPEG images

Authored by muhlenpfordt on Sep 17 2018, 7:43 AM.

Description

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
  • FileSave or FileSave 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

Details

Committed
muhlenpfordtSep 21 2018, 6:24 AM
Reviewer
Gwenview
Differential Revision
D15455: Fix orientation when saving/transforming JPEG images
Parents
R260:6e8d8facee8d: Set file name on print job
Branches
Unknown
Tags
Unknown