From: waszm at freemail dot hu
Operating system: win32
PHP version: 5.0.1
PHP Bug Type: GD related
Bug description: imagecolorAllocate doesnt set backgroundcolor after
imageCreateTrueColor
Description:
------------
When I use imageCreateTrueColor instead of imageCreate, and I call
imagecolorAllocate(), the background color won't be changed.
I got a black background instead of a green. My gd version is bundled
(2.0.28 compatible)
Reproduce code:
---------------
<?php
$image1=imageCreate(100, 100);
$image2=imageCreateTrueColor(100, 100);
$green1=imageColorAllocate($image1, 0, 128, 256);
$green2=imageColorAllocate($image2, 0, 128, 256);
print'In case of imagCreate(): ';
if(imageColorAt($image1, 1, 1)==$green1){
print'Ok, background is green.';
}else{
print'Background is black.';
}
print'<br>In case of imagCreateTrueColor(): ';
if(imageColorAt($image2, 1, 1)==$green2){
print'Ok, background is green.';
}else{
print'Background is black.';
}
?>
Expected result:
----------------
In case of imagCreate(): Ok, background is green.
In case of imagCreateTrueColor(): Ok, background is green.
Actual result:
--------------
In case of imagCreate(): Ok, background is green.
In case of imagCreateTrueColor(): Background is black.
--
Edit bug report at http://bugs.php.net/?id=29834&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29834&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29834&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29834&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29834&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29834&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29834&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29834&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29834&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29834&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29834&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29834&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29834&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29834&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29834&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29834&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29834&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29834&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29834&r=float