|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-03 22:16 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
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