Try something like this in PHP
// filename of the original image
$fileName = “cow.jpg”;
// load the original image from the file
$original = imagecreatefromjpeg($fileName);
// degrees to rotate the image (counter clockwise)
$angle = 90.0;
// rotate the image by $angle degrees
$rotated = imagerotate($original, $angle, 0);
// print the appropriate header type
// this tells the browser we’re displaying a jpeg image
header(‘Content-type: image/jpeg’);
// use the imagejpeg() method to display the rotated image
imagejpeg($rotated);
This will rotate it 45 Degrees:
// filename of the original image
$fileName = “cow.jpg”;
// degrees to rotate the image (counter clockwise)
$angle = 45.0;
// if the resulting image is not rectangular..
// .. what colour will the uncovered bits be?
$bgColour = 0xFFFFFF; // red
// load the original image from the file
$original = imagecreatefromjpeg($fileName);
// rotate the image by $angle degrees
$rotated = imagerotate($original, $angle, $bgColour);
// print the appropriate header type
// this tells the browser we’re displaying a jpeg image
header(‘Content-type: image/jpeg’);
// use the imagejpeg() method to display the rotated image
imagejpeg($rotated);
I’ve never done it but I’m sure it works =)
Found the code at
https://discomoose.org/2006/04/28/rotating-pictures-with-php/
Have fun!
Abraham