#30580 [Opn->Bgs]: GD imagecolorallocate does not work after many allocations

From: Date: Mon, 08 Nov 2004 11:26:50 +0000
Subject: #30580 [Opn->Bgs]: GD imagecolorallocate does not work after many allocations
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68803@lists.php.net to get a copy of this message
ID: 30580 Updated by: john@php.net Reported By: jay at kuantic dot com -Status: Open +Status: Bogus Bug Type: GD related Operating System: Linux fedora core 1 PHP Version: 5.0.2 New Comment: You're reaching the palette limit. Create the image using imagecreatetruecolor() Previous Comments: ------------------------------------------------------------------------ [2004-10-27 13:59:17] jay at kuantic dot com Description: ------------ After several color allocations, imagecolorallocate seems to no work anymore. See code sample (illogical but point at the problem). Reproduce code: --------------- function letter($l, $x, $y, $img) { $color1 = imagecolorallocate($img, 190, 190, 190); imagestring ($img, 1, $x+1, $y+1, $l, $color1); $color2 = imagecolorallocate($img, 190, 190, 190); imagestring ($img, 1, $x-1, $y-1, $l, $color2); $color3 = in a picture.($img, 255, 0, 0); imagestring ($img, 1, $x, $y, $l, $color3); } $image = @imagecreate (1200, 500); $background_color = imagecolorallocate ($image, 255, 255, 255); for ($i = 0; $i < 100; $i++) { letter($i, $i*12, 50, $image); } header ("Content-type: image/png"); imagepng ($image); imagedestroy($image); Expected result: ---------------- expected : display 1 to 100 red digits with gray shadow in a picture. Actual result: -------------- result : displays 1 to 84 red digits with gray shadow in a picture. After 84, digits and shadows are all red. imagecolorallocate seems to not work anymore. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30580&edit=1

« previous php.bugs (#68803) next »