From:             jay at kuantic dot com
Operating system: Linux fedora core 1
PHP version:      5.0.2
PHP Bug Type:     GD related
Bug description:  GD imagecolorallocate does not work after many allocations

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 bug report at http://bugs.php.net/?id=30580&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30580&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30580&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30580&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30580&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30580&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30580&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30580&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30580&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30580&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30580&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30580&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30580&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30580&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30580&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30580&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30580&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30580&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30580&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30580&r=mysqlcfg

Reply via email to