so
<?
load existing jpeg
$src_img = imagecreatefromjpeg($imagefile);
compute 25% of it's width/height
$new_w = imagesx($src_img)/4;
$new_h = imagesy($src_img)/4;
create new thumbnail image
$dst_img = imagecreate($new_w,$new_h);
anc copy original jpeg and resize it
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
save new thumbnail
imagejpeg($dst_img, "scratch/$imagefile");
echo "<img src=scratch/$imagefile>\n";
?>
it's good enough?🙂