|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-12 13:37 UTC] pajoye@php.net
[2008-08-12 13:45 UTC] amelek32 at gmail dot com
[2008-08-12 14:25 UTC] pajoye@php.net
[2008-11-30 22:52 UTC] pajoye@php.net
[2008-12-01 11:00 UTC] amelek32 at gmail dot com
[2008-12-01 11:02 UTC] pajoye@php.net
[2009-03-10 11:25 UTC] mmcnicklebugs at googlemail dot com
[2009-03-14 16:34 UTC] tabe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ imagepng *crashes* when no color was alocated. I see no point in rendering blank images, but this functions behavior is buggy. All other functions (imagejpeg, imagegif) AND imagepng on true scale images return black image. This is most likely expected result. Instead, this function flushes some part of header and then crashes with warnings when trying to convert non existing color palette. GD Version bundled (2.0.34 compatible) Reproduce code: --------------- <? $img = imagecreate(500,500); //header("Content-type: image/png"); // skip this to see the problem, else browser will ignore corrupted image. imagepng($img); imagedestroy($img); ?> Expected result: ---------------- blank black image (like other image* functions) or E_WARNING without junk. Actual result: -------------- ?PNG IHDR???M? Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: Invalid number of colors in palette in C:\usr\apache\httpd\html\draw.php on line 21 Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in C:\usr\apache\httpd\html\draw.php on line 21