Prevent wrong orientation from EXIF data with Thumbor filters
See original GitHub issueWhen I access an image with orientation EXIF data, the output is often automatically rotated to an incorrect orientation. This seems to be a common issue: https://github.com/awslabs/serverless-image-handler/issues/220, https://github.com/awslabs/serverless-image-handler/issues/25
The current solution seems to be to include "rotate": null
in the edits list. However, I’d prefer to access images using the Thumbor filters, so directly modifying the edit list isn’t possible. Using a null
value in the rotate
Thumbor filter also doesn’t look like it’s possible.
A previous solution was to modify the RESPECT_ORIENTATION
config value, however this doesn’t look like it’s supported using Sharp.
I saw that Sharp supports a PRESERVE_EXIF_INFO
config value. I tried to override this by setting a Lambda environment variable of the same name to True
, but this didn’t have any effect. Perhaps this isn’t the right way to set the config value.
Any ideas would be greatly appreciated! It seems like this should just be the default behaviour…
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Hello, I still have the bug on my cloudfront… are you sure the bug is fixed ? thanks
@avario I’m trying to experiment
withMetadata()
but it’s not working properly when I providedrotate
value. I’ll update once I find the permanent resolution of this issue.