|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-23 09:40 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 11:00:02 2025 UTC |
Description: ------------ The function imagesavealpha() has an opposite effect on the output image if the color is marked as transparent. For example, the code below should always create a clear image. But it renders as black. The interesting thing is that if you remove the imagesavealpha , the image renders as expected (clear). Reproduce code: --------------- <?php $img = imagecreatetruecolor(100,100); $trans = imagecolorresolve($img,0,0,0); imagecolortransparent($img, $trans); imagealphablending($img, false); imagefilledrectangle($img, 0,0, 100,100, $trans); //Has opposite affect imagesavealpha($img,true); header('Content-Type: image/png'); imagepng($img); ?> Expected result: ---------------- nothing (a clear image) Actual result: -------------- a solid black image