Black background when rotating image with PHP
<p>I´m trying to rotate a PNG image with PHP. The image rotates but a black background appears.</p>

<p>This is my code:</p>

<pre><code>$image = $_GET['image'];
$degrees = $_GET['degrees'];

header('Content-type: image/png');
$source = imagecreatefrompng($image) ;
$rotate = imagerotate($source, $degrees, 0);
imagesavealpha($rotate, TRUE);
imagepng($rotate);

return rotate;
</code></pre>
