Bug #12963: ImageColorAllocate() doesn't work with PNGs

From: Date: Sun, 26 Aug 2001 10:01:52 +0000
Subject: Bug #12963: ImageColorAllocate() doesn't work with PNGs
Groups: php.dev 
Request: Send a blank email to php-dev+get-64339@lists.php.net to get a copy of this message
From: perry@globalnet.co.uk Operating system: Windows95 PHP version: 4.0.6 PHP Bug Type: *Graphics related Bug description: ImageColorAllocate() doesn't work with PNGs <?php header ("Content-type: image/png"); $text=implode($argv," "); $image=imageCreateFromPNG("basic.png"); $background_color = ImageColorAllocate ($im, 100, 100, 255); $text_color=imageColorAllocate($image,255,100,100); $textX=(imageSX($image)-imageFontWidth(4)*strlen($text))/2; imageString($image,5,$textX,10,$text,$text_color); imagePNG($image); imageDestroy($image); ?> This is only a small modification of the example given in the manual, but the $text_color is always white. This works for JPEG, but the quality suffers, and my build of PHP doesn't support GIF's. -- Edit bug report at: http://bugs.php.net/?id=12963&edit=1

« previous php.dev (#64339) next »