Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent wrong orientation from EXIF data with Thumbor filters #235

Closed
avario opened this issue Oct 1, 2020 · 12 comments
Closed

Prevent wrong orientation from EXIF data with Thumbor filters #235

avario opened this issue Oct 1, 2020 · 12 comments
Assignees
Labels

Comments

@avario
Copy link

avario commented Oct 1, 2020

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: #220, #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...

@avario avario added the question label Oct 1, 2020
@beomseoklee
Copy link
Member

@avario Do you have an example that I can try to reproduce so that we would think of the solution?

@avario
Copy link
Author

avario commented Oct 2, 2020

@beomseoklee Here's an example of the automatic rotation effect:
image

Here's a direct link to the original image: https://bouldermap.s3.amazonaws.com/D624927E-AC6D-4B4D-84BC-E833093EBAAC.jpg

You can see that it has the correct orientation because the EXIF data for this file is intact.

Here's a link to the image accessed through Serverless Image Handler: https://d2ahr1fgdkzi3r.cloudfront.net/fit-in/300x400/D624927E-AC6D-4B4D-84BC-E833093EBAAC.jpg

You can see that it has been automatically rotated to the wrong orientation because the EXIF data has been stripped.

@avario
Copy link
Author

avario commented Oct 8, 2020

@beomseoklee Any ideas on this?

@beomseoklee
Copy link
Member

@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.

@avario
Copy link
Author

avario commented Oct 13, 2020

@beomseoklee Have you made any progress on this? I'd really like to get this deployed. If it's not going to be possible to use thumbor filters I can just look into using the an encoded edits list.

@beomseoklee
Copy link
Member

@avario I'm preparing a new update including this issue. We are planning to release the new version in this month, but it can be delayed to the next month. If it's not possible to wait for you, it would be better to use the encoded edits list with rotate: null for now.

@avario
Copy link
Author

avario commented Nov 8, 2020

@beomseoklee Do you have any news on when this update will be released?

@beomseoklee
Copy link
Member

Thanks for waiting @avario
We've fixed this issue in v5.1.0.

@avario avario closed this as completed Nov 20, 2020
@dovepa
Copy link

dovepa commented Sep 2, 2021

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

@marco910
Copy link

marco910 commented Mar 4, 2024

I'm using the latest version of the serverless image handler (v6.2.5) and still face the issue. But this only occurs in Chrome, not in Safari for example. When using the strip_exif filter in the URL, the image is rotated correctly.

@simonkrol
Copy link
Member

Hi @marco910, the resources for this issue seem to have expired which make debugging a bit difficult. Could you open a new issue with some additional context for what you're running into?

@marco910
Copy link

marco910 commented Mar 5, 2024

Hi @simonkrol I created a new issue #537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants