#21524 [NEW]: Add imagesavealpha so that imagepng can output alpha channel

From: Date: Wed, 08 Jan 2003 19:22:36 +0000
Subject: #21524 [NEW]: Add imagesavealpha so that imagepng can output alpha channel
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29467@lists.php.net to get a copy of this message
From: phpbugs@koimo.net Operating system: All PHP version: 4.3.0 PHP Bug Type: Feature/Change Request Bug description: Add imagesavealpha so that imagepng can output alpha channel (Not sure whether this should be here or under GD related) It would be useful if PHP had access to the gdSaveAlpha function in the GD library. Using PHP 4.3.0 with bundled GD, there is currently no way I can see to prevent imagepng stripping the alpha channel of a truecolor image. The following script produces a white circle on a black background, rather than a semi-transparent circular 'hole': <?php $image = imagecreatetruecolor(200, 200); imagealphablending($image, false); imagefilledellipse($image, 100, 100, 150, 150, 0x3fffffff); header('Content-type: image/png'); imagepng($image); ?> According to the GD change list at http://www.boutell.com/gd/manual2.0.9.html#whatsnew2.0.2 this is the correct default behaviour since version 2.0.2 - there is a function gdSaveAlpha to turn on and off alpha output which appears to be present in the bundled GD in CVS but at the moment without any PHP wrapper. A PHP function imagesavealpha(resource image, bool savealpha) would allow alpha output when required without breaking any existing scripts. -S. Haydon -- Edit bug report at http://bugs.php.net/?id=21524&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21524&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21524&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21524&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21524&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21524&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21524&r=support Expected behavior: http://bugs.php.net/fix.php?id=21524&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21524&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21524&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21524&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21524&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21524&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21524&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21524&r=gnused

« previous php.bugs (#29467) next »