This is the code - I can't take credit for it - I found it when looking up GD, and it was then modified by someone else interested in doing the same thing.
And yes - the originals are a reasonable size. Due to their nature, it's important to have the large originals so that people can see the detail in the rug designs.
I'm starting to think it may be too tricky to use the originals without any prep work for thumbs this small.
<?php
// Max Sizes
$th_max_width = 96; // Maximum width of the thumbnail
$th_max_height = 144; // Maximum height of the thumbnail
//-------------------
// File
$filename = $_GET['file'];
// Content type
header('Content-type: image/jpeg');
// Get image sizes
list($width, $height) = getimagesize($filename);
// Resize
$ratio = ($width > $height) ? $th_max_width/$width : $th_max_height/
$height;
$newwidth = round($width * $ratio);
$newheight = round($height * $ratio);
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
//Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight,
$width, $height);
// Output
imagejpeg($thumb);
?>
<?php
exit;
?>