makeThumb.class.php extension == "jpg"){ $src = ImageCreateFromJpeg($upfile); $dst = ImageCreateTrueColor($tn_width, $tn_height); ImageCopyResized($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height); ImageJpeg($dst, $dstfile); } else { $src = ImageCreateFromGif($upfile); $dst = ImageCreateTrueColor($tn_width, $tn_height); ImageCopyResized($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height); ImageGif($dst, $dstfile); } } } ?> example.php extension = $grabExt[1]; $tum->upfile = $_FILES['file']['tmp_name']; $tum->dstfile = "mythumb/" . $_FILES['file']['name']; $tum->makeThumb(100,100); ?>