Option to rotate images by exif information
My current service needs to thumbnail images on my S3 bucket, some of which are stored in their original orientation but with EXIF rotation data on the right way up.
Currently, this means that when I thumbnail images, it resizes them the wrong way up, then strips the metadata telling me which way is up. Even with save_metadata enabled, this would mean that a 300x200 resize is now a 200x300 image.
I'd like a function to rotate images based on this information, if it exists in the image, that I can apply before the thumbnailing.
[Deleted User] commented
AdminJason (Feedback Manager, Blitline) commented
This should happen automatically. After opening a file, we auto orient it based on the EXIF. A common occurance, though, is that the image has already been rotated based on EXIF, but EXIF wasn't updated. This leads to Blitline opening the file, seeing that there is EXIF rotation data, and automatically rotating it (but since the photo was already corrected, the EXIF information still says it's rotated), so Blitline re-rotates, causing an incorrect image.
If you know that the photos are already rotated correctly, you can disable the "auto rotation" by adding "suppress_auto_orient" to the base json.
"app_id" : "<YOUR APP ID>",
"src" : "<YOUR SRC>",
"suppress_auto_orient" : true,