#22323 [Opn->Csd]: There's no way to output transparent truecolor PNG images
ID: 22323
Updated by: sniper@php.net
Reported By: jukkaho at mail dot student dot oulu dot fi
-Status: Open
+Status: Closed
Bug Type: GD related
Operating System: Linux
PHP Version: 4.3.0
Assigned To: pajoye
New Comment:
But the latest stable version is the latest STABLE CVS snapshot in
which this works fine.
Previous Comments:
------------------------------------------------------------------------
[2003-12-22 15:55:36] jukkaho at mail dot student dot oulu dot fi
I'm sorry, but this bug needs to be reopened.
With current (stable) PHP version 4.3.3 with GD lib bundled (2.0.15
compatible), I'm unable to create transparent png images.
Usage example in previous comment does _not_ work any more and result
image has black background with no alpha information.
------------------------------------------------------------------------
[2003-02-26 17:24:34] pajoye@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.
imagesavealpha has been added in cvs.
The simple imagesavealpha wrapper is used.
usage:
<?php
$im = imagecreatetruecolor(200,200);
imagealphablending($im, false);
imagesavealpha($im, true);
imagefilledrectangle($im,20,20,150,150, 0x40FF0000);
imagepng($im, 'alpha.png');
?>
thank's for your report
pierre
------------------------------------------------------------------------
[2003-02-20 23:49:14] jukkaho at mail dot student dot oulu dot fi
I have submitted a proposed patch to the development mailing list (see
http://marc.theaimsgroup.com/?l=php-dev&m=104577317709538&w=2).
When
everything's ok in cvs snapshot, this bug is closed.
There's no state 'should be fixed in cvs' so this stays open. :)
------------------------------------------------------------------------
[2003-02-20 08:13:55] jukkaho at mail dot student dot oulu dot fi
Relevant parts are not changed in CVS so there are still no way to call
gdImageSaveAlpha() with a true argument so that alpha channel is
actually sent to browser.
Default value is still set to 0 and has the following comment:
/* 2.0.2:
alpha blending is now on by default, and saving of
alpha is off by default. This allows font
antialiasing to work as expected on the first try
in JPEGs -- quite important -- and also allows
for smaller PNGs when saving of alpha channel is
not really desired, which it usually isn't! */
im->saveAlphaFlag = 0;
In my case it really is desired. I want to be able to produce
transparent PNGs. I just don't have access in PHP to change
saveAlphaFlag value.
Someone could just create a new PHP image function
ImageSaveAlpha($im,$bool) that passes that info to gdImageSaveAlpha
(gdImagePtr im, int saveAlphaArg);
I have solved my blending problems already by using undocumented
functions as I have described in bug #22327.
------------------------------------------------------------------------
[2003-02-20 07:30:49] 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
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22323
--
Edit this bug report at http://bugs.php.net/?id=22323&edit=1
Thread (8 messages)