Inspect EXIF data for rotation - Image orientation/rotation is wrong for some images
See original GitHub issueI tried compressing a photo taken with my Samsung Galaxy S8 (in portrait orientation) but the image shows up in wrong orientation (rotated 90 degrees) in https://squoosh.app/ and there also didn’t seem to be any option to rotate the image.
The photo shows in correct orientation if I view it e.g. in image preview of macOS Finder. If I save the compressed image from squoosh then it will show up in wrong orientation also in other apps.
I suspect the issue is that squoosh doesn’t take into account the EXIF Orientation information in the photo.
Here’s the photo I had the issue with:
(Ps. looks like the image also appears in wrong orientation in this GitHub issue using Chrome at least, but if I click on it so that it opens in a new tab then it is shown in the correct orientation. It should be shown so that the text is oriented horizontally [easily readable].)
If I check the EXIF data of the image (with e.g. exiftool) I can see it has the correct orientation info:
$ exiftool test.jpg | grep Orientation
Orientation : Rotate 90 CW
Or checking with identify (from ImageMagick):
$ identify -verbose test.jpg | grep Orientation
Orientation: RightTop
exif:Orientation: 6
exif:thumbnail:Orientation: 6
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:36 (1 by maintainers)
Top GitHub Comments
Btw I just tested my image (the one above) by loading it into https://squoosh.app/ in these browsers.
Tested on macOS Mojave 10.14.1
Tested on Android 8.0.0 (Samsung Galaxy S8):
All of these browsers consistently show the image in wrong orientation (all the same way) when loaded into Squoosh. I also tested loading this GitHub issue in all of these browsers and it was exactly the same. All browsers tested show the image in the same way. In the
<img>
tag in an HTML document the image is always shown wrongly oriented. And in all of the browsers when opening the image directly in a new tab, only then the image is shown in correct orientation.I’m working on a rotate option right now. The second phase of this would be to read exif data to set the rotation automatically. Thanks for filling this!