work that into a function and you are good to go.
took like 1/2 to get iut right.
all the other examples don't use true color.
the images come out crappy.
$picture_location = "./picture.jpg";
$picture_save = "./picturethumb2.jpg";
$size=78; // size in pixel u want the picture to come out
$im_size = GetImageSize ( $picture_location);
$imageWidth = $im_size[0];
$imageHeight = $im_size[1];
// - or with GD 2+ -
// do all your color allocations here
//$font_color_black = ImageColorAllocate( $im, 0,0,0);
$im2 = ImageCreateFromJPEG($picture_location);
if ($imageWidth>=$imageHeight)
{
$width=$size;
$height = ($width/$imageWidth)$imageHeight;
}
else
{
$height=$size;
$width = ($height/$imageHeight)$imageWidth;
}
$im = imageCreateTrueColor( $width, $height );
ImageCopyResized ($im,$im2, 0, 0, 0, 0, $width, $height, $imageWidth, $imageHeight);
Header("Content-type: image/jpeg");
Imagejpeg($im,'',100); //to print to screen
Imagejpeg($im,$picture_save,100);
ImageDestroy($im);
ImageDestroy ($im2);