php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22544 truecolor transparent png bug in PHP's bundled libgd but not in the real gd
Submitted: 2003-03-04 23:10 UTC Modified: 2003-03-05 10:04 UTC
From: swbrown at ucsd dot edu Assigned: iliaa (profile)
Status: Closed Package: GD related
PHP Version: 4.3.2-dev OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: swbrown at ucsd dot edu
New email:
PHP Version: OS:

 

 [2003-03-04 23:10 UTC] 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);

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-05 06:56 UTC] sniper@php.net
nevermind..

 [2003-03-05 08:21 UTC] 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 10:04 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC