Some Images showed "libpng warning: Interlace handling should be turned on when using png_read_image"
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?
https://sourceforge.net/p/libpng/bugs/165/
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
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