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

Issue with using Nginx ngx_http_image_filter_module #102

Open
chrisastley opened this issue Oct 13, 2021 · 3 comments
Open

Issue with using Nginx ngx_http_image_filter_module #102

chrisastley opened this issue Oct 13, 2021 · 3 comments

Comments

@chrisastley
Copy link
Contributor

Hi,

Recently I have started using the new option in Magento for dynamic image resizing based on the URL parameters (https://devdocs.magento.com/guides/v2.4/config-guide/remote-storage/config-remote-storage-image-resize.html)

This has been working great but I recently realised that I had disabled your module while testing and did get around to re-enabling it.

Now that I have enabled it the links in the aren't correct for the srcset items.

<picture class="product-image-photo"> <source type="image/webp" srcset="https://vehiclematsuk.com/media/catalog/product/f/o/ford-mustang-mach-e-car-mats-2020-present-sys2748_qzmopu.webp"> <source type="image/jpg" srcset="https://vehiclematsuk.com/media/catalog/product/f/o/ford-mustang-mach-e-car-mats-2020-present-sys2748_qzmopu.jpg"><img data-hasoptions="1" class="product-image-photo" src="https://vehiclematsuk.com/media/catalog/product/f/o/ford-mustang-mach-e-car-mats-2020-present-sys2748_qzmopu.jpg?width=320&amp;height=320&amp;store=default&amp;image-type=small_image" alt="Ford&amp;#x20;Mustang&amp;#x20;Mach-E&amp;#x20;Car&amp;#x20;Mats&amp;#x20;&amp;#x28;2020-present&amp;#x29;" loading="lazy" width="320" height="320"></picture>
You can check here https://vehiclematsuk.com/ford-mustang-car-mats

That is the output on the category page, you can see the img tag has the correct URL along with parameters that allow nginx to serve the resized image, but the 2 srcset image links do not have the parameters so the image is the full-sized original version. This results in the webp image being a lot larger than the resized jpeg in the img.

Not sure what is the best way to resolve this or if it is just as simple as keeping the parameters from the original link and adding to the srcset items?

Thanks

@chrisastley
Copy link
Contributor Author

Hi,

Thanks for the quick reply, it is Magento. The setting only became available recently, you can see it shown here in the official documentation. https://docs.magento.com/user-guide/configuration/general/web.html#url-options

Magento has also renamed the original method of image caching/thumbnailing as legacy so I'm not sure if they plan to phase it out in favour of dynamic resizing.

@chrisastley
Copy link
Contributor Author

Hi, can I have a reply on this? You did reply and then deleted it for some reason.

@jissereitsma
Copy link
Contributor

Unfortunately my time has been limited and I have a backlog of numerous open source tickets, this being one of them. I need to work harder to make sure I'm able to pick up on this. I started to reply but realized that I needed quite some time to do anything here. I will try to invest free time in this somewhere in the future, but I can't say when.

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

2 participants