-
Notifications
You must be signed in to change notification settings - Fork 540
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
Wrong image rotation because of EXIF data when using Thumbor filters #537
Comments
Hi @marco910, Can you provide an example of a request (you can redact the distribution URL and filename if you'd like) that sees this happen? If you download the image and open it locally through Mac preview or a similar Windows tool, does the image show properly? My intuition is that you're running into a similar issue as #495, where some browsers don't support rotational metadata for WebP images. So even though the metadata is being maintained in the result, the browser doesn't know what to do with it. One reason Safari likely works is that it doesn't support WebP images, so SIH is returning the image in the same format as it exists in the S3 bucket. Let me know, |
Do you mean a screenshot from an example request or the request headers? When downloading both the original image (which is display correctly in the browser) and the flipped image to my Mac and opening both in the Preview app, both images are rotated correctly. It was also my though that it works in Safari because of the missing WebP support. Both Firefox and Chrome (which support WebP) are having the issue. |
Hi @marco910, It appears that the issue is tracked in chrome under https://bugs.chromium.org/p/webp/issues/detail?id=445 , though it has been closed as wontfix, so we likely won't see support anytime soon. Unfortunately a fix on our end likely falls outside the scope of the solution, and could introduce a behaviour change for other customers. If your use case allows it, you could consider disabling AutoWebP, or include Let me know if that works for you, |
Hi @simonkrol We're only using Thumbor filters vie the URL. Here are a few examples:
We experienced the issue very rare and only with portrait images taken with smartphones. After exporting the images for example in Photoshop, the EXIF data get's removed and the image will get returned correctly from SIH. I totally understand that you can not make any changes to the current solution. That's not what I want either because it obviously a browser issue. We agreed with internally and without client to prevent using portrait images or stripping EXIF data before using them through SIH. This prevents the flipped images in some browsers. Thanks for your help and the awesome AWS solution you built with the SIH! |
Hi @marco910, It might be worth trying out Thanks for using SIH :) |
Hi @marco910 , Thank you, |
Hi @simonkrol , Thanks for reaching out. I would really appreciate giving you some insights and feedback about the solution. I'll send you a message on LinkedIn and then we can schedule a call. Marco |
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 theformat(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:
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.
The text was updated successfully, but these errors were encountered: