Edit report at https://bugs.php.net/bug.php?id=71316&edit=1
ID: 71316
User updated by: humbads at alum dot mit dot edu
Reported by: humbads at alum dot mit dot edu
Summary: libpng warning from imagecreatefromstring
Status: Open
Type: Bug
Package: GD related
Operating System: FreeBSD 10.2
PHP Version: 5.6.17
Block user comment: N
Private report: N
New Comment:
A workaround is to run the following ImageMagick command on the PNG file before processing:
mogrify -strip 1CCHOHSULGF78KW.png
Source:
http://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile
Previous Comments:
------------------------------------------------------------------------
[2016-01-08 22:07:27] humbads at alum dot mit dot edu
Description:
------------
imagecreatefromstring is writing a warning message to stderr that can not be suppressed by
'@' or captured by the error handler. It should emit a proper PHP warning instead.
I have the following version of libPNG:
php -i | grep -i libpng
libPNG Version => 1.6.19+apng
To run the test script, download the sample PNG image from here:
http://imgbox.com/BzOXLiOr
Note: libPNG 1.5.18 on PHP 5.6.17 for Windows does not have this problem.
Test script:
---------------
php -r
'@var_dump(imagecreatefromstring(file_get_contents("1CCHOHSULGF78KW.png")));'
Expected result:
----------------
resource(6) of type (gd)
Actual result:
--------------
libpng warning: iCCP: known incorrect sRGB profile
resource(6) of type (gd)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71316&edit=1