0) $imagewidth = $_GET["width"]; if ($_GET["height"]>0) $imageheight = $_GET["height"]; if ($imagewidth == 0) $imagewidth = ($w*$ratio); if ($imageheight == 0) $imageheight = ($h*$ratio); } else { $imagewidth = $w; $imageheight = $h; } switch($type) { case 1: $im = @imagecreatefromjpeg($image); /* Attempt to open */ $thumb = imagecreatetruecolor($imagewidth, $imageheight); imagecopyresampled($thumb, $im, 0, 0, 0, 0, $imagewidth, $imageheight, $w, $h); header("Content-Type: image/gif"); imagegif($thumb); break; case 2: $im = @imagecreatefromjpeg($image); /* Attempt to open */ $thumb = imagecreatetruecolor($imagewidth, $imageheight); imagecopyresampled($thumb, $im, 0, 0, 0, 0, $imagewidth, $imageheight, $w, $h); header("Content-Type: image/jpeg"); imagejpeg($thumb); break; case 3: $im = @imagecreatefrompng($image); /* Attempt to open */ $thumb = imagecreatetruecolor($imagewidth, $imageheight); imagecopyresampled($thumb, $im, 0, 0, 0, 0, $imagewidth, $imageheight, $w, $h); header("Content-Type: image/png"); imagepng($thumb); break; } ?>