#22544 [Fbk->Opn]: truecolor transparent png bug in PHP's bundled libgd but not in the real gd
| From: | sniper@php.net | Date: | Wed, 05 Mar 2003 12:56:44 +0000 |
| Subject: | #22544 [Fbk->Opn]: truecolor transparent png bug in PHP's bundled libgd but not in the real gd | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-34876@lists.php.net to get a copy of this message | ||
ID: 22544
Updated by: sniper@php.net
Reported By: swbrown at ucsd dot edu
-Status: Feedback
+Status: Open
Bug Type: GD related
Operating System: any
-PHP Version: 4.3.1
+PHP Version: 4.3.2-dev
New Comment:
nevermind..
Previous Comments:
------------------------------------------------------------------------
[2003-03-05 06:42:56] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-03-04 23:10:02] swbrown at ucsd dot edu
PHP's bundled gd doesn't properly handle transparent truecolor pngs.
At the time it bundled gd, neither did gd, but 2.0.11 handles it now.
Some of the files in PHP's libgd report having been updated to 2.0.11
(gd.c, revision 1.41), but either the update wasn't successful or not
all of the files have been updated yet. I tested this with 4.3.1 and
swapping in php4/php5 CVS head's libgd as well - same problem. It
works when linking to a real gd 2.0.11 install. I'm adding this as a
bug so it'll be easier to keep track of this problem.
Here's a test case that will show the problem. Note that if you use IE
on win32 to view the result, it'll look like it failed even if it
didn't, as win32 IE has its own issues with truecolor transparent
pngs.
<?php
// Example demonstrating a transparent truecolor png bug
// fixed by the time of gd 2.0.11, but not fixed in php's
// bundled gd.
header("Content-type: image/png");
$image = imageCreateTruecolor(640, 100);
$transparent = imageColorAllocate($image, 0, 0, 0);
$red = imageColorAllocate($image, 255, 50, 50);
imageColorTransparent($image, $transparent);
imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
imageString($image, 3, 0, 0, "If the background is black, and you
aren't on win32 IE (buggy png code), this is a bug.", $red);
imagePng($image);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22544&edit=1