PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #39366 imagerotate preserve alpha channel only if degree less then 45
Submitted:3 Nov 2006 10:16pm UTC Modified: 4 Nov 2006 3:24am UTC
From:ciakana at gmail dot com Assigned to:pajoye
Status:Closed Category:GD related
Version:5.2.0 OS:Windows XP
View/Vote Developer Edit Submission

[3 Nov 2006 10:16pm UTC] ciakana at gmail dot com
Description:
------------
If I run the allegated script, where shade.png is a png image with a
transparent background (full alpha channel), all works if the degrees
are less then 45. If I set the degrees to 300, for example, the
background become black.

Reproduce code:
---------------
<?php
$filename="shade.png";
$degrees =300;
header('Content-type: image/png');
$source = imagecreatefrompng($filename);
$rotate = imagerotate($source, $degrees, -1);
imagealphablending($rotate, true);
imagesavealpha($rotate, true);
imagepng($rotate);
?>

Expected result:
----------------
An image with a black bakground

Actual result:
--------------
A rotated copy of the original image with the alpha channel preserved
[3 Nov 2006 10:18pm UTC] ciakana at gmail dot com
Description:
------------
If I run the allegated script, where shade.png is a png image with a
transparent background (full alpha channel), all works if the degrees
are less then 45. If I set the degrees to 300, for example, the
background become black.

Reproduce code:
---------------
<?php
$filename="shade.png";
$degrees =300;
header('Content-type: image/png');
$source = imagecreatefrompng($filename);
$rotate = imagerotate($source, $degrees, -1);
imagealphablending($rotate, true);
imagesavealpha($rotate, true);
imagepng($rotate);
?>

Expected result:
----------------
A rotated copy of the original image with the alpha channel preserved

Actual result:
--------------
An image with a black bakground
[4 Nov 2006 3:24am UTC] pajoye@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC