From: eckounlimited at gmx dot nnet
Operating system: Every
PHP version: 5CVS-2005-05-02 (dev)
PHP Bug Type: GD related
Bug description: ImageRotate() lost of alphalayer
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 bug report at http://bugs.php.net/?id=32921&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32921&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32921&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32921&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32921&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32921&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32921&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32921&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32921&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32921&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32921&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32921&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32921&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32921&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32921&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32921&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32921&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32921&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32921&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32921&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32921&r=mysqlcfg