From:             seth at pricepages dot org
Operating system: Mac 10.4
PHP version:      5.2.1
PHP Bug Type:     GD related
Bug description:  imagesavealpha() has opposite effect on transparent color

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

Reply via email to