ID: 32921
Updated by: [EMAIL PROTECTED]
Reported By: eckounlimited at gmx dot nnet
-Status: Open
+Status: Feedback
Bug Type: GD related
-Operating System: Every
+Operating System: *
PHP Version: 5CVS-2005-05-02 (dev)
New Comment:
Are you using bundled gd library or external one?
(what do you pass to --with-gd configure option?)
Previous Comments:
------------------------------------------------------------------------
[2005-05-03 08:44:10] eckounlimited at gmx dot nnet
Description:
------------
Imagerotate between -45 an 45 degree including an alphachannel is no
problem! 46 to -44 ist still replacing the background with black.
Ohh i forgot: If you rotate, you have to specify an backgroundcolor by
imagecolorallocatealpha(!) and set imagealphablending to false and
imagesavealpha to true to get an transparent rotated png...
Reproduce code:
---------------
<?PHP
$rot = 35;
$i = imagecreatetruecolor(300,300);
imagealphablending($i, FALSE);
imagesavealpha($i,TRUE);
$whitetrans = imagecolorexactalpha($i,255,255,255,127);
imagefilledrectangle($i,0,0,200,200,$whitetrans);
$o = imagecreatefrompng("./rotate.png");
$o = imagerotate($o,$rot,$whitetrans,0);
imagecopyresampled($i,$o,0,0,0,0,300,300,300,300);
imagepng($i,"test".$rot.".png");
?>
Expected result:
----------------
This works fine and copys a transparent PNG with 35 degree to the new
test.png.
If you change now $rot = 35 to $rot = 46 the rotated png will appear on
an black background.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32921&edit=1