Reputation: 1593
Title says JPEG. But I tried PNG. It didn't work. GD supports imagerotate function.
if (function_exists('imagerotate')) {
echo "test";
}
It outputs the word test. So i assume I have imagerotate function.
$im = imagecreatetruecolor($width + 10, $height + 10);
...
I did some image porcess. I can see the processed image without any problem. But i want to rotate the final image. So i did the following.
imagerotate($im,180,0);
imagepng($im,$png,9);
imagedestroy($im);
But I am still getting the image without rotation. I even just tried to rotate a image without doing any process. It didn't work too.
Upvotes: 0
Views: 3404
Reputation: 1096
You need to assign the rotated image to another variable before create the png.
$rotatedImage = imagerotate($im,180,0);
imagepng($rotatedImage,$png,9);
imagedestroy($rotatedImage);
Upvotes: 3