question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent wrong orientation from EXIF data with Thumbor filters

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
dovepacommented, Sep 2, 2021

Hello, I still have the bug on my cloudfront… are you sure the bug is fixed ? thanks

2reactions
beomseokleecommented, Oct 8, 2020

@avario I’m trying to experiment withMetadata() but it’s not working properly when I provided rotate value. I’ll update once I find the permanent resolution of this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent wrong orientation from EXIF data with Thumbor filters
When I access an image with orientation EXIF data, the output is often automatically rotated to an incorrect orientation.
Read more >
Configuration — Thumbor 7.2.0 documentation
If this option is set to True, thumbor will reorient the image according to it's EXIF Orientation tag (if one can be found)....
Read more >
Thumbor Documentation - Read the Docs
Thumbor is a smart imaging service. It enables on-demand crop, resizing and flipping of images. It features a VERY smart detection of ...
Read more >
Best Thumbnailing Solution — Set up Thumbor on AWS
You'll also probably want to change respect orientation from false to true in order for Thumbor to respect the exif data of jpeg...
Read more >
The #1 Speaker Placement Tip That Speaker Manuals Get ...
It turned out to be bad advice that only served to confuse me, ... So now I need to be close to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found