I have created this simple script and i know it works but i am afraid that there may be a better way and that there may be leftover temp files. I pieced this together and i am unsure of the function of each method. This simply takes defined information and creates a new image. If anyone has something similar in there library or suggestions i would appreciate it.
$pic ='Blue hills.jpg'; // start image
$loc='thumbs/'; // location to write new file
$new_name='newthumb.jpg'; // new name for image
$new_w=200; // maximum width of the new image
create_image($pic,$loc,$new_name,$new_w); // call function
function create_image($pic,$loc,$new_name,$new_w)
{
$im = imagecreatefromjpeg($pic);
$orwidth=imagesx($im); // get original width
$orheight=imagesy($im); //get original height
$ratio = $orwidth/$orheight; // calc image ratio
$new_h = round($new_w/$ratio,0); // calc new height keeping ratio of original
$new_image=ImageCreateTrueColor($new_w,$new_h);
imagecopyresized($new_image,$im,0,0,0,0,$new_w,$new_h,$orwidth,$orheight);
imagejpeg($new_image,$loc.$new_name,20);
imagedestroy($new_image);
}