-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
WebP images don't auto orient based on EXIF metadata #259
Comments
@SigmundurMorkore can you provide the image in question? |
Right sorry, was in a hurry when writing this issue up. Here you go @brianpopow :) This is the JPG being formatted with: And then this is the same JPG but being converted to WebP with: |
Made a discovery! It seems Firefox and Chrome both fail to rotate the webp image. But Safari does manage to rotate the webp image correctly. Could this instead be a browser issue? |
Is this somehow the same issue as here: #258 ? |
We've tried replicating our issue with JPG, but have only been able to replicate the issue when the image format is WebP. So considering #258 has an issue with JPG, it would seem to be that these are different issues 🤷♂️ |
@SigmundurMorkore this really looks to me like a issue with the auto orient of the viewer (=browser). The Exif Information is preserved with both:
The browsers I tested: chrome, opera, firefox seem to ignore exif with webp and with jpg they all rotate the image according to exif. Not sure yet how #258 is related. I have not looked into that so far. |
@brianpopow Yeah that would make sense... I wonder why I am unable to find anyone else having this issue with webp in browsers. Is it possible to actually rotate the image and removing the orientation exif metadata with ImageSharp.Web? |
This actually seems to also be an issue with PNG and AVIF: https://zpl.fi/exif-orientation-in-different-formats/ So it would seem to be ideal to be able to actually rotate the image (and removing the orientation metadata) |
I think we dont have that yet in ImageSharp.Web, @JimBobSquarePants please correct me if I am wrong. Should we maybe add a |
The |
It seems we had I think its worth reconsidering this, as I believe auto orient makes sense also without resizing. |
We have added our own AutoOrientProcessor for now (following the code in #220), which solves our issue. Agree it is worth reconsidering adding it to ImageSharp.Web officially. Our working image with the AutoOrientProcessor 🥳 |
Yeah let’s re-add it. Was hoping to avoid it to preserve consistency with the CSS spec but with all those daft browser bugs we’ll need a backup plan. |
The |
I wish it was a bug in our code. It’s definitely a browser issue. We’re tracking the EXIF properties properly and orienting accordingly. Browsers are just super poor at implementing the CSS spec for the different image formats. That’s what happens when you cobble together a bunch of different libraries I guess… |
Since we can't fix browser issues I would consider #260 to be an adequate workaround for now. |
Prerequisites
DEBUG
andRELEASE
modeImageSharp.Web version
2.0.0
Other Six Labors packages and versions
2.1.1
Environment (Operating system, version and so on)
Linux
.NET Framework version
5
Description
When formatting a jpg image to webp using
?format=webp
the resulting webp image does not orient itself according to the jpg's exif orientation metadata.Formatted as JPG, the image is oriented correctly. Formatted as WebP, the image is oriented sideways.
Steps to Reproduce
Try to format a JPG image with orientation metadata to WebP with the following parameters:
?format=webp
The image will not be oriented according to the metadata.
Images
No response
The text was updated successfully, but these errors were encountered: