PHP Warning: imagecreatefrompng(): gd-png: libpng warning: iCCP: known incorrect sRGB profile in [...]\james-heinrich\phpthumb\phpthumb.class.php on line 3796 on php8.1.2x and php8.2 #221
On php 8.1.2x (8.1.28 at the moment) and 8.2.18
When parsing certain png phpthumb is returning this warning:
PHP Warning: imagecreatefrompng(): gd-png: libpng warning: iCCP: known incorrect sRGB profile in [...]\james-heinrich\phpthumb\phpthumb.class.php on line 3796 (i hid the full path).
To "fix" it, you can change line 3796 of phpthumb.class.php
from:
$gd_image = $ImageCreateFromFunctionName($filename);
to
$gd_image = @$ImageCreateFromFunctionName($filename);
You still have the warning in the error log, but the png image is processed.
On php 8.1.2x (8.1.28 at the moment) and 8.2.18 When parsing certain png phpthumb is returning this warning:
PHP Warning: imagecreatefrompng(): gd-png: libpng warning: iCCP: known incorrect sRGB profile in [...]\james-heinrich\phpthumb\phpthumb.class.php on line 3796
(i hid the full path).To "fix" it, you can change line 3796 of phpthumb.class.php from:
$gd_image = $ImageCreateFromFunctionName($filename);
to$gd_image = @$ImageCreateFromFunctionName($filename);
You still have the warning in the error log, but the png image is processed.