image icon indicating copy to clipboard operation
image copied to clipboard

Some Images showed "libpng warning: Interlace handling should be turned on when using png_read_image"

Open cuimingda opened this issue 7 years ago • 3 comments

I use the same code to test Image:make, some image is OK, some will display warning:

libpng warning: Interlace handling should be turned on when using png_read_image

I test for some cases:

$warningImageUrl = "https://www.bulgari.cn/media/catalog/product/cache/815b9fb227016af97d5136ae474ea5a3/3/5/355148_001_1.png";
$fineImageUrl = "https://www.vancleefarpels.cn/content/dam/rcq/vca/16/27/32/3/1627323.png";

Image::make($warningImageUrl); // output warning

Image::make($fineImageUrl); // output nothing

$image = Image::make($warningImageUrl); // output warning
$image->interlace(false);
$image->save(storage_path("test.png"));

Image::make(storage_path("test.png")); // output nothing

what is the differences between the two png images? and although there is warning, but images saved succeed.

My question is how to disable this warning?

cuimingda avatar Sep 15 '18 09:09 cuimingda

https://sourceforge.net/p/libpng/bugs/165/

skylei avatar Dec 24 '18 08:12 skylei

I had the same warning when running my tests using libpng 1.6.34

I fixed it using GIMP by re-exporting the image to PNG and I had to uncheck Interlacing (Adam7)

More about how (not) interlacing will affect on your image on this stackexange answer

cbaconnier avatar Sep 03 '19 13:09 cbaconnier

Contributing to @cbaconnier's solution, If you don't have access to GIMP, you can use ImageMagick.

Once installed, interlaced can be removed by running:

magick convert -interlace none path/to/source-image.png path/to/target-image.png

robertoaguilar-ftf avatar Feb 07 '23 15:02 robertoaguilar-ftf