EXIF orientation is not taken into account in uploaded images

Bug #1792039 reported by Sean Manning on 2018-09-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Libravatar
Medium
François Marier

Bug Description

When I upload images like this coin, making sure that they are oriented so that the face is looking left or right, they appear rotated with the face looking upwards. I do not see any way to rotate them in libravatar, just to crop them. Cropping the original, larger image so it is taller than it is wide or wider than it is tall does not help.

Sean Manning (antiquarian) wrote :
François Marier (fmarier) wrote :

I suspect the problem is that the includes a mandatory rotation in the Exif data and that jpegoptim strips it out:

$ file before.jpg
before.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, Exif Standard: [TIFF image data, little-endian, direntries=11, manufacturer=Panasonic, model=DMC-SZ10, orientation=upper-right, xresolution=166, yresolution=174, resolutionunit=2, software=Shotwell 0.22.0], baseline, precision 8, 2302x2121, frames 3

$ cp before.jpg after.jpg
$ jpegoptim --strip-all after.jpg
after.jpg 2302x2121 24bit N Exif XMP JFIF [OK] 740417 --> 728927 bytes (1.55%), optimized.

$ file after.jpg
after.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 2302x2121, frames 3

Changed in libravatar:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → François Marier (fmarier)
François Marier (fmarier) wrote :

Actually the problem comes before jpegoptim enters the picture. The images served out of /uploaded/ are not rotated properly on the "Crop photo" page and the browser will only apply the EXIF rotation if the image is navigated to directly.

Maybe we need to run exiftran (https://www.kraxel.org/blog/linux/fbida/) first on all of the uploaded images to ensure that the orientation is fixed up before crop happens.

summary: - Image Automatically Rotated Wrong-Way Up
+ EXIF orientation is not taken into account in uploaded images
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers