Welcome Guest, Not a member yet? Register   Sign In
ErrorException imagecreatefrompng()
#1
Question 
(This post was last modified: 01-17-2022, 10:21 AM by hosterfy.)

Hello,

I publish this issue, because there is an error when we try to import into a form a PNG image. The issue occurs only for PNG images, not for JPG.

ErrorException
imagecreatefrompng(): gd-png: libpng warning: Interlace handling should be turned on when using png_read_image

You can see it on this screenshot : https://prnt.sc/26et5v1

The impacted PHP version is 7.4.27 (all required extensions installed like GD, ImageMagick, etc. But when i change to PHP version 7.3.33 all is working.

I really don't understand why there is this issue only on 7.4 and above PHP version..

Also, i checked the above code, the image is properly uploaded but the CI code part is impacted by this issue :


PHP Code:
foreach($data['files'] as $file){
 
$edit_image = \Config\Services::image()
 
        ->withFile($file["file"])
 
        ->fit(400400'center')
 
        ->save($file["file"]);         
 
}
 
$avatar $file["name"]; 


Sorry about my bad english.

Thanks in advance.
Reply
#2

I don't know this article is correct or not, but for your information:
PNG – deactivate interlace to avoid ‘libpng warning: Interlace handling should be turned on when using png_read_image’ – mixable Blog
https://mixable.blog/png-deactivate-inte...ead_image/
Reply
#3

Hello,
Thanks for your reply, and yes i already see that, but the issue is CI side / configuration, because this function is a lib into CI.
Thanks.
Reply
#4

Got the same problem. Is it any way to fix this?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB