Skip to content

Wrong image rotation because of EXIF data when using Thumbor filters #537

Closed
@marco910

Description

@marco910

Describe the bug
When resizing images using thumbor filters in the URL, some images get flipped to the left side in some browsers (see additional context). This only happens to images that were processed by the serverless image handler, not to the original image which is served directly from the S3 bucket.
I checked the images where the issue occurs and saw that all those images have an orientation value set in their EXIF metadata (e.g. 6 when they are wrongly flipped to the left side instead of portrait).
On my serverless image handler deployment is the AUTO_WEBP option enabled, which automatically returns WebP images when the browser supports it. When adding the format(jpg) thumbor filter to the request, a JPG is returned and the image rotated correctly (even with the EXIF data inside it).
When stripping the EXIF data using the strip_exif thumbor filter, the image is also rotated correctly no matter of it's a JPG or WebP.

Expected behavior
Images should always be rotated correctly no matter if an orientation is set in the EXIF data or the output format is a WebP, JPG, PNG or similar.

Please complete the following information about the solution:

  • Version: v6.2.5
  • Region: eu-central-1
  • Was the solution modified from the version published on this repository? => No
  • If the answer to the previous question was yes, are the changes available on GitHub? => No, because not modified
  • Have you checked your service quotas for the sevices this solution uses? => Yes
  • Were there any errors in the CloudWatch Logs? => No errors in the log

Additional context
The images are only flipped to the left side in Chromium browser. In for example Safari everything looks fine.

I'm not sure if this is a browser issue, serverless image handler issue, or WebP issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions