I found this script that i think works well, but it doesn't generate a new file it will only show a thumbnail on the page calling it.
you create a file like thumbnail.php
put this code in
$src = $_GET['src'];
// create and return a thumbnail version of a jpg image
// $src is passed in URL
// set up height and width of the created thmbnail
$width = 100;
$height = 65;
// read in the passed image
$im = imagecreatefromjpeg ("$src"); // Attempt to open
// create a blank image of the required size
$new = imagecreatetruecolor ($width, $height);
// copy a resied version of the original to the new image
imagecopyresized($new,$im,0,0,0,0,$width,$height,imagesx($im),imagesy($im));
// output header and file
header ("content-type: image/jpeg");
imagejpeg ($new);
// clear the image buffers
imagedestroy ($im);
imagedestroy ($new);
alter the height and width as you see fit.
then on the page you want to view it type
<img src="thumbnail.php?src=foldername/filename.jpg"/>
and you can play around with it to get what you want.