-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Description
JPEG files can embed EXIF metadata specifying one of 8 mirroring+rotation options. Only 2-3 of these are in common use, from people holding their phones sideways when taking pictures. It would be nice of the image/jpeg package could, perhaps optionally, correct for these. Camlistore will be doing it on its own, but it seems like something the image/jpeg package is in a good position to do automatically. It's probably only safe to do the left-90 and right-90 ones automatically (and only when width & height change), so users can detect whether the operation has already been done and not apply the transformation again, as orientation-fixing code has to do anyway (because you can't trust whether upstream software in the wild fixed the metadata for you when it flipped-and-resaved the image, so you also have to check the before & after dimensions). If we want to do this in image/jpeg, I've attached a screenshot of the 8 modes and a tarball of 16 JPEG files: 1 for each mode without EXIF, and 1 for each mode with the Orientation field set to "fix" the image back to a lowercase eff letter. The f files are written on 8x8 pixel boundaries, so we can do pixel-wise compares in tests safely.
Attachments:
- exif-orientations.png (22969 bytes)
- f.tar (30720 bytes)
metalmatze, murphysean, gbl08ma, fzxu, ebridges and 26 moreendlesstravel, nikolaydubina and djpiper28