Snippets - GD
Rotate an image - Anthony 14/6/2008
Rotate an image; again a lot more complicated than using Imagemagick.
<?php// Set the path to the image to rotate$input_image = "House.jpg";//How many degrees you wish to rotate$degrees = 180;// Create the canvas$canvas = imagecreatefromjpeg( $input_image ) ;// Rotates the image$rotate = imagerotate( $canvas, $degrees, 0 ) ;// Save the image as output.jpgimagejpeg( $rotate, "output.jpg" );// Clear the memory of the tempory imageimagedestroy( $canvas );?>