Anyone can comment on a bug. Have a simpler test case? Does it
work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please
— but make sure to vote on the bug!

Your email address:MUST BE VALID

Solve the problem:39 + 7 = ?

Subscribe to this entry?

[2016-01-08 22:07 UTC] 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)

Thanks for your report!
Hm. This is a libpng warning.I suppose they move this warning to a simple warning level.
I will see if we can implement the warning only callback without introducing too much noises:
png_structp png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn);
only png_error is used now and generates php error.