From: info at silisoftware dot com Operating system: Windows XP Pro PHP version: 4.3.6 PHP Bug Type: GD related Bug description: ImagePNG transparency broken on truecolor images
Description: ------------ ImagePNG does not output transparent PNG images when in true-color mode, but does when in paletted mode. Before this gets thrown in the bogus pile as a browser issue - it's not - please download both these files and open them in Photoshop and see whether or not the transparency is recognized. This issues was previously addressed (http://bugs.php.net/bug.php?id=22323) but appears to be re-broken and still not fixed in the latest version (4.3.6) Reproduce code: --------------- $Image = ImageCreateTrueColor(80,40); $back = ImageColorAllocate($Image,255,255, 0); $red = ImageColorAllocate($Image,255, 0, 0); $green = ImageColorAllocate($Image, 0,255, 0); $black = ImageColorAllocate($Image, 0, 0, 0); ImageColorTransparent($Image, $back); ImageFilledRectangle($Image,0,0,80,40,$back); ImageArc($Image,20,20,32,32,120,0, $red); ImageString($Image,5,20,20, 'hello', $black); //ImageTrueColorToPalette($Image, true, 256); ImagePNG($Image, 'c:/bad.png'); Expected result: ---------------- I expect this: http://www.silisoftware.com/temp/imagepng-transparency/good.png A red arc, black text on a transparent background. And I do get this if I use the commented-out line above to convert the true color image to a paletted image. Actual result: -------------- I get this: http://www.silisoftware.com/temp/imagepng-transparency/good.png A red arc, black text on a yellow (non-transparent) background. -- Edit bug report at http://bugs.php.net/?id=28341&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28341&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28341&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28341&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28341&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28341&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28341&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28341&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28341&r=support Expected behavior: http://bugs.php.net/fix.php?id=28341&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28341&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28341&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28341&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28341&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28341&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28341&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28341&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28341&r=float
