magefan / module-lazyload

https://magefan.com/magento-2-image-lazy-load-extension
Other
53 stars 16 forks source link

Enabling the module together with WebP renders no images #15

Closed onepack closed 4 years ago

onepack commented 4 years ago

Magento 2.3.4 Latest Lazyload

Enabling the Webp module gives blank category pages. All product images in the grids seem empty.

ihorvansach commented 4 years ago

Hello @onepack , could you please specify what WebP module do you use? Can you provide a link to that module?

onepack commented 4 years ago

The One from Yireo: yireo/magento2-webp2 (I fixed a small issue with that module (check issues) but it works good now.)

What I see is a grid product image:

<picture alt="Twydil Beback" class="product-image-photo">
    <source type="image/webp" srcset="https://website.com/pub/static/version1583405601/frontend/Onepack/customer/en_US/Magefan_LazyLoad/images/pixel.webp">
    <source type="image/jpg" srcset="https://website.com/pub/static/version1583405601/frontend/Onepack/customer/en_US/Magefan_LazyLoad/images/pixel.jpg">
    <img src="https://website.com/pub/media/catalog/product/cache/acabac73159397632273e7e78b9e82fb/t/w/twy_mluokhxbk1zs8wlj.jpg" data-original="https://website.com/pub/media/catalog/product/cache/acabac73159397632273e7e78b9e82fb/t/w/twy_mluokhxbk1zs8wlj.jpg" class="product-image-photo initial loaded" max-width="240" max-height="300" alt="Twydil Beback" data-was-processed="true"></picture>

However in the Block images it seems to be ok without lazy load applied:

<picture>
    <source type="image/webp" srcset="https://website.com/pub/media/Banners/EN_Shop_winterdekens.webp">
    <source type="image/jpg" srcset="https://website.com/pub/media/Banners/EN_Shop_winterdekens.jpg">
    <img src="https://website.com/pub/media/Banners/EN_Shop_winterdekens.jpg" alt="" width="400" height="515" class="initial loading" data-was-processed="true"></picture>
magefan commented 4 years ago

@onepack , unfortunately, our lazy load extension does not compatible with yireo/magento2-webp2, as it has critical issues, it does not work well with full-page cache and varnish, that is why we recommend to use Magento 2 WebP extension by Magefan.