#28341 [Opn->Bgs]: ImagePNG transparency broken on truecolor images
| From: | magnus@php.net | Date: | Mon, 10 May 2004 00:25:37 +0000 |
| Subject: | #28341 [Opn->Bgs]: ImagePNG transparency broken on truecolor images | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59448@lists.php.net to get a copy of this message | ||
ID: 28341
Updated by: magnus@php.net
Reported By: info at silisoftware dot com
-Status: Open
+Status: Bogus
Bug Type: GD related
Operating System: Windows XP Pro
PHP Version: 4.3.6
New Comment:
Works fine here.
If you're using IE, change to a browser with a working png
implementation such as Mozilla Firefox.
Previous Comments:
------------------------------------------------------------------------
[2004-05-10 01:46:20] info at silisoftware dot com
Correction on the URLs:
Expected Result:
http://www.silisoftware.com/temp/imagepng-transparency/good.png
Actual Result:
http://www.silisoftware.com/temp/imagepng-transparency/bad.png
------------------------------------------------------------------------
[2004-05-10 01:44:06] info at silisoftware dot com
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 this bug report at http://bugs.php.net/?id=28341&edit=1