|
<? // http://www.thaiall.com/yonokenlarge/thumb.php ini_set('memory_limit', '80M'); header('Content-Type: image/jpeg'); imagejpeg(thumb("yne0002.jpg")); // $_GET["f"] // function thumb($source_pic) { $tn_width = 100; $tn_height = 100; $tmp = imagecreatetruecolor($tn_width,$tn_height); list($width, $height, $image_type) = getimagesize($source_pic); switch ($image_type) { case 1: $src = imagecreatefromgif($source_pic); break; case 2: $src = imagecreatefromjpeg($source_pic); break; case 3: $src = imagecreatefrompng($source_pic); break; default: return ''; break; } imagecopyresampled($tmp,$src,0,0,0,0,$tn_width, $tn_height,$width,$height); $final_image =$tmp; return $final_image; } ?> |