Open patrickt opened 7 years ago
I'd like us to either detect this or add a rotate option within MLTSHP
I have now seen a thing this week where the IMAGE will show up fine but the thumbnails are sideways.
Copying over testing info from the Slack. This was prompted by @jessamynwest reporting seeing her image right side up, but everyone else seeing it sideways.
about:cache
for an image with Exif tags.about:cache
corresponding to an image being displayed with the Exif Orientation Tag ignored/not present.Behavior is identical for uploading via Chrome - the uploaded image is temporarily cached, including Exif tags, causing it to be correctly oriented. On reload, image is sideways.
I suspect what's happening is that the Exif Orientation tags are being stripped or ignored. This comment suggests that Orientation data is preserved on upload even in Mobile Safari, and desktop should be fine, so it's probably happening server side?
Tested on both Chrome and Firefox, MacOS, I see different behavior between the docker build and the live site.
Uploaded to docker instance, Exif tags survive the round trip of upload/download: orientation is preserved. Uploaded via FF to live instance, Exif tags disappear after upload/download, so orientation breaks on reload.
I have solved the EXIF orientation tag puzzle before and my advice is to strip out the tag as early as possible in the upload process. The way I've dealt with it before is with a utility called jhead:
jhead -autorot [file]
But the HEIC conversion process does make it a little more tricky. Stripping out the EXIF orientation tag must also be combined with resorting the pixels (which is what jhead
does) otherwise you end up with sideways images. So if there's some way to leave the tags intact through the conversion to JPEG, that method could possibly work here.
I think mltshp currently doesn't handle HEIC or a bunch of other formats at all. #562