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

WebP encoding not honouring the Exif orientation data? #375

Open
4 tasks done
robertjf opened this issue Jul 25, 2024 · 4 comments
Open
4 tasks done

WebP encoding not honouring the Exif orientation data? #375

robertjf opened this issue Jul 25, 2024 · 4 comments

Comments

@robertjf
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp.Web
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

ImageSharp.Web version

3.1.3

Other Six Labors packages and versions

SixLabors.ImageSharp 3.1.5

Environment (Operating system, version and so on)

Umbraco 13.4.1, Umbraco Cloud

.NET version

8

Description

We have come across an image or two that behave strangely when the webp format is applied in the query string to manipulate the image:

image

In order to test with the latest version of ImageSharp/ImageSharp.Web I have applied the latest versions of the NuGet packages to the project. The original versions were 3.1.3 and 3.1.0 respectively.

This is the URL for the image on the left:

https://youritteam.com.au/media/wzpnn4zs/image-5.jpeg?width=800&height=1067&format=webp&quality=70&v=1dadd68d1c2e900 (broken)

And this is the same URL without the webp format applied, which renders in the correct orientation:

https://youritteam.com.au/media/wzpnn4zs/image-5.jpeg?width=800&height=1067&quality=70&v=1dadd68d1c2e900

The original image is below (it's possible the copy on the website will be replaced soon).

Steps to Reproduce

Host the sample image and render it with the format=webp (no other parameters are required) on the URL.

Images

exif-webp-issue

@JimBobSquarePants
Copy link
Member

See https://github.com/SixLabors/ImageSharp.Web/issues/375

It's the browser. It doesn't respect the EXIF metadata

@robertjf
Copy link
Author

Hm. Given that this is the case, is there an option to ignore exif when applying WebP as a way around this?

@JimBobSquarePants
Copy link
Member

No, you can't really ignore the format like that.

You could inject your own version of AutoOrientWebProcessor that only operates if the format is WebP or you intend to convert to WebP though. You would ensure it always runs first by injecting a command via OnParseCommandsAsync

@aloksharma1
Copy link

aloksharma1 commented Oct 8, 2024

@JimBobSquarePants i think my issue is related to this see here https://therattlecat.com/1/Blogs/IMG-5811ahfJI8E57qnQBJD.jpeg?&format=webp&quality=80&w=850&bgcolor=ffffff

can you give me a sample of how i need to apply my own AutoOrientWebProcessor the webp image in my link becomes upside down

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

No branches or pull requests

3 participants