//**************************************
// Name: Image rotation using GD extension
// Description:A function with the intention of rotating a Jpeg image 90° Clockwise, Counterclockwise and 180°(Flip).
// By: Karl Blessing
//
//
// Inputs:Source file ( path to the source )
//Destination ( path to the destination, can be same as source if you want to overwrite )
//degrees (integer value of 90(counterclockwise), 270(clockwise) or 180)
//
// Returns:does not return a value, will save the destination, no indication if successful is returned.
//
//Assumes:When writing this I found various behaviors between images with greater x than y's and so forth. Thus is why all the condiotionals. The function has not been tested for images with same x and y dimensions, and will not likely work.
//IMPORTANT:
//You must have PHP 4.3.* or above for this function to work, a PHP version lower will not work. I was using PHP 4.3.2 for Win32, with GD Extension version 2 ( bundled with PHP ).
//
//Side Effects:None
//This code is copyrighted and has limited warranties.
//Please see [url]http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.1074/lngWId.8/qx/vb/scripts/ShowCode.htm[/url]
//for details.
//**************************************