I posted this question a couple of weeks ago in comp.lang.php but
never got any responses:

-----------------------------------------------------------------
Does the gd "imagerotate" function in PHP5 work correctly or am I
doing something wrong?

I'm using the code shown below to generate a simple rectangle and then
to rotate it a specific number of degrees. The actual rotation itself
seems to happen OK but the background color appears correctly only if
the rotation is between 1 and 45 degrees; any other value and the
background is black. And, "imagecolortransparent" does not work at all
(I want the background to be transparent).

While trying to figure this out, I stumbled across the ImageMagick
library of routines. On their web site, one can actually manipulate an
image on-line. I was surprised to find that rotating an image there
seems to be limited to +/- 45 degrees also.

Is there any way I can rotate an image to, say, 60 degrees?

- - - - - - - - - - - - - - - - - - - - - - - - -
PHP code:

$myImg = imagecreate($somelength,$somewidth);
$myBG = imagecolorallocate($myImg,85,255,255);
$RectColor = imagecolorallocate($myImg,200,200,200);
$myBlack = imagecolorallocate($myImg, 0, 0, 0);
imagefilledrectangle($myImg,1,1,($somelength-2),($somewidth-2),
$RectColor);
imagerectangle($myImg,0,0,($somelength-1),($somewidth-1), $myBlack);

$myImage = imagerotate($myImg, $someangle, $myBG);

imagedestroy($myImg);

imagecolortransparent($myImage,$myBG);

imagepng($myImage,"gMyRect.png");
imagedestroy($myImage);