ID:               29834
 Updated by:       [EMAIL PROTECTED]
 Reported By:      waszm at freemail dot hu
-Status:           Open
+Status:           Bogus
 Bug Type:         GD related
 Operating System: win32
 PHP Version:      5.0.1
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

imagecolorAllocate() is for images created via 
imagecreate() (256 colors only). 
 


Previous Comments:
------------------------------------------------------------------------

[2004-08-25 14:59:50] waszm at freemail dot hu

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 this bug report at http://bugs.php.net/?id=29834&edit=1

Reply via email to