yireo / Yireo_Webp2

Magento 2 module to add WebP support to Magento 2
Open Software License 3.0
194 stars 54 forks source link

Interlace handling should be turned on when using png_read_image #134

Closed andremc420 closed 1 year ago

andremc420 commented 1 year ago

Hello,

I've been getting a lot of these in my exception.log:

main.CRITICAL: Warning: imagecreatefrompng(): gd-png: libpng warning: Interlace handling should be turned on when using png_read_image in (Magento)/vendor/rosell-dk/webp-convert/src/Convert/Converters/Gd.php on line 210 {"exception":"[object] (Exception(code: 0): Warning: imagecreatefrompng(): gd-png: libpng warning: Interlace handling should be turned on when using png_read_image in (Magento)/vendor/rosell-dk/webp-convert/src/Convert/Converters/Gd.php on line 210 at (Magento)/vendor/magento/framework/App/ErrorHandler.php:61)"} []

Magento 2.4.3-p2, PHP 7.4.30, module version 0.3.10.

Any ideas how to fix this?

jissereitsma commented 1 year ago

This is actually not an issue with the Magento extension, or the underlying rosell-dk/webp-convert library, but actually with your PHP GD library. Most likely your libpng library on Linux is outdated. Perhaps updating PHP would help. Otherwise try to upgrade libpng.

andremc420 commented 1 year ago

Hello @jissereitsma thanks for your reply!

I checked with my hosting support, actually these libraries should be up to date. I don't think this version of Magento will run with php above 7.4.

I googled this error and stumbled upon this, but I'm not sure if that would be the correct fix - or even how to implement it.

jissereitsma commented 1 year ago

Could you report than the flavor of Linux, the specific version of that flavor and that libpng version? Then we can determine which bug arises in what version.

As for the work around, yeah, you could try that. It has zero to do with this module, Magento or PHP code. It simply has to do with removing interlacing in the images you have added to the shop.

andremc420 commented 1 year ago

I'm running:

CentOS v7.9.2009 STANDARD standard

php74-php-gd 7.4.30-1.1.9.cpanel

libpng.x86_64 2:1.5.13-8.el7 1.5.13

jissereitsma commented 1 year ago

Thanks. I'm not a libpng expert, but on my system I can run convert -list format | grep PNG which tells me version 1.6.37 is far more current. My guess is that the bug in libpng will be fixed by upgrading. Unfortunately, upgrading CPanel from 2009 is really out of scope here. The clues are here for you to pick up upon. Still, because this is not an issue with this module, Magento or PHP in general, I'm closing this issue.