Código PHP:
<?
Header("Content-type:image/jpeg");
$imagen = @$_GET['imagen'];
$calidad = 85;
$thumbwidth = 80;
$thumbheight = 60;
$src_img = ImageCreateFromJPEG( $imagen );
$w = imagesx( $src_img );
$h = imagesy( $src_img );
$width= $w;
$height= $h;
if( $width > $thumbwidth ) {
$ratio = $thumbwidth / $width;
$width = $thumbwidth;
$height = $height*$ratio;
}
if( $height > $thumbheight ) {
$ratio = $thumbheight / $height;
$height =$thumbheight;
$width = $width*$ratio;
}
$dst_img = imagecreatetruecolor( $width, $height );
imagecopyresampled( $dst_img, $src_img, 0, 0, 0, 0, $width, $height, $w, $h );
ImageJPEG( $dst_img, '', $calidad );
ImageDestroy( $src_img );
Imagedestroy( $dst_img );
?>