From: seth at pricepages dot org Operating system: Mac 10.4 PHP version: 5.2.1 PHP Bug Type: GD related Bug description: Alpha composite allows color to bleed through
Description: ------------ I am filling the background of an image with a transparent red (it shouldn't have an effect on the rest of the drawing). Over it, I'm drawing a black, semi-transparent, square. Reproduce code: --------------- $img = imagecreatetruecolor(100, 100); imagealphablending($img, true); $trans = imagecolorresolvealpha($img,255,0,0, 127); imagefill($img, 0,0, $trans); $pTrans = imagecolorresolvealpha($img, 0,0,0, 64); imagefilledrectangle($img, 10, 10, 50, 50, $pTrans); imagealphablending($img, false); imagesavealpha($img,true); header('Content-Type: image/png'); imagepng($img); Expected result: ---------------- I would expect the resulting image to be 100% transparent, except for a grey, 50% transparent square. Actual result: -------------- Instead, the black is mixed with the red to form a dark-red semi-transparent square. The red color should not be there, because it was 100% transparent. -- Edit bug report at http://bugs.php.net/?id=40572&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40572&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40572&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40572&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40572&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40572&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40572&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40572&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40572&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40572&r=support Expected behavior: http://bugs.php.net/fix.php?id=40572&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40572&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40572&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40572&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40572&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40572&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40572&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40572&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40572&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40572&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40572&r=mysqlcfg