ID: 40601
Updated by: [EMAIL PROTECTED]
Reported By: seth at pricepages dot org
-Status: Open
+Status: Bogus
Bug Type: GD related
Operating System: Mac 10.4
PHP Version: 5.2.1
-Assigned To:
+Assigned To: pajoye
New Comment:
Transparent color and alpha cannot work together when you save a file.
PNG supports one or another not both (PNG is also the only format
supporting alpha).
You will get a warning/error in libpng if you try to do the same calls
(for example in C).
not a bug > bogus.
Previous Comments:
------------------------------------------------------------------------
[2007-02-23 03:04:57] seth at pricepages dot org
Description:
------------
The function imagesavealpha() has an opposite effect on the
output image if the color is marked as transparent. For
example, the code below should always create a clear image.
But it renders as black.
The interesting thing is that if you remove the imagesavealpha
, the image renders as expected (clear).
Reproduce code:
---------------
<?php
$img = imagecreatetruecolor(100,100);
$trans = imagecolorresolve($img,0,0,0);
imagecolortransparent($img, $trans);
imagealphablending($img, false);
imagefilledrectangle($img, 0,0, 100,100, $trans);
//Has opposite affect
imagesavealpha($img,true);
header('Content-Type: image/png');
imagepng($img);
?>
Expected result:
----------------
nothing (a clear image)
Actual result:
--------------
a solid black image
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40601&edit=1