ProAnswers.org

How do you create thumbnails with PHP?

How do you create thumbnails with PHP?

here is a little script that should do the thing:

$save = "yourfolder";
$modwidth = 100;
header('Content-type: image/jpeg') ;
list($width, $height) = getimagesize($file) ;
$modper = $modwidth/$width;
$modheight = $height * $modper;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100);

it is called GD script (used to make images via PHP)