Forum Moderators: coopster
I have the following code that generates a thumbnail using GD, but the thing is it does it on the fly, can anyone please tell me how i can use it to save the file first and then display it.
$image = $_GET['src'];
$scale = 20;
$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];
$type = $size[2];
$scale = $scale/100;
$newwidth = round($width*$scale);
$newheight = round($height*$scale);
header ("Content-type: image/jpeg");
$src = imagecreatefromjpeg("$image");
$im = imagecreate($newwidth,$newheight);
imagecopyresized($im,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($im);
imagedestroy($im);
Cheers