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 images scale/crop incorrect when using CDN and querystring extension=webp (5.4.1) #125

Open
robmaas opened this issue Dec 1, 2022 · 0 comments

Comments

@robmaas
Copy link

robmaas commented Dec 1, 2022

Version of Dianoga

5.4.1

Environment description

Sitecore 10.2 with Dianoga 5.4.1 and CDN enabled.

What configs you have enabled

Dianoga.DisableForSite.config
Dianoga.Jpeg.config
Dianoga.Png.config
Dianoga.Strategy.MediaCacheAsync.config
Dianoga.WebP.CDN.config
Dianoga.WebP.config
(web.config handler set to Dianoga.MediaRequestHandler)

Reproducible steps (1... 2... 3...) that cause the issue

Start site with WebP.config and WebP.CDN.config enabled, disable MediaProtection for easier testing.
Open both URL's:

https://{example.com}/-/media/default%20website/cover.jpg?h=200&w=1200&crop=1&fx=0.08854166&fy=-0.05937505
https://{example.com}/-/media/default%20website/cover.jpg?h=200&w=1200&crop=1&fx=0.08854166&fy=-0.05937505&extension=webp

What you expected to see, versus what you actually saw

Image with same scale/cropping should be returned, instead:

Without extension parameter.
https://{example.com}/-/media/default%20website/cover.jpg?h=200&w=1200&crop=1&fx=0.08854166&fy=-0.05937505
returns content-type:image/jpeg and image:

image

With extension parameter.
https://{example.com}/-/media/default%20website/cover.jpg?h=200&w=1200&crop=1&fx=0.08854166&fy=-0.05937505&extension=webp
returns content-type:image/webp and image:

image

When disabling the CDN configuration and using just the 'normal' WebP configuration (without querystring parameter) it works fine and image content-types are returned based on the accept header.

Relevant logs

No relevant logs.

I cannot find any earlier mention of a similar issue, so if this has already been fixed in later version of Dianoga I'm happy to upgrade.
If we can fix this by passing the accept header in Azure CDN instead, that's also an acceptable solution for me. I'm reporting the issue anyway, maybe I'm missing something here?

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

No branches or pull requests

1 participant