#22544 [Asn->Csd]: truecolor transparent png bug in PHP's bundled libgd but not in the real gd
| From: | iliaa@php.net | Date: | Wed, 05 Mar 2003 16:04:47 +0000 |
| Subject: | #22544 [Asn->Csd]: 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-34895@lists.php.net to get a copy of this message | ||
ID: 22544
Updated by: iliaa@php.net
Reported By: swbrown at ucsd dot edu
-Status: Assigned
+Status: Closed
Bug Type: GD related
Operating System: any
PHP Version: 4.3.2-dev
Assigned To: iliaa
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-03-05 08:21:44] iliaa@php.net
The sync with gd 2.0.11 was only done for PHP 5-dev, I'll make a patch
for 4.3.2 today.
------------------------------------------------------------------------
[2003-03-05 06:56:43] sniper@php.net
nevermind..
------------------------------------------------------------------------
[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