Comment 27 for bug 29627

Revision history for this message
In , Aurélien Gâteau (agateau) wrote :

This is because the JPEG image dimensions are not a multiple of the MCU size see [1] for an explanation). In this case, there are three solutions to perform a rotation:

1: Apply a lossless rotation, keeping the odd pixels around. Rotating the image the other way will give you back the original image.

2: Apply a lossless rotation, but trim the offending pixels, in your case this would reduce the height of the rotated image from 900 to 896. Rotating the image the other way won't give you back the original image.

3: Apply a lossy rotation, which would give a correct image, but would probably loose some details.

For now, Gwenview adopts a conservative behavior and use #1. What do you think should be done? let the user choose the solution? select #2 or #3 without asking?

If you want to try #2, edit imageutils/jpegcontent.cpp, find the line that says:

  transformoption.trim = false;

and change it to:

  transformoption.trim = true;

[1]: http://www.impulseadventure.com/photo/jpeg-minimum-coded-unit.html