thum.php 파일생성
<?
$fn = $_GET["fn"];
$path = "../data/file/apply_list/";
$imageloade = $path.$fn;
$source_image = imagecreatefromjpeg($imageloade);
$source_imagex = imagesx($source_image);
$source_imagey = imagesy($source_image);
$dest_imagex = 170;
$dest_imagey = 110;
$dest_image = imagecreatetruecolor($dest_imagex, $dest_imagey);
imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $dest_imagex, $dest_imagey, $source_imagex, $source_imagey);
header("Content-Type: image/jpeg");
imagejpeg($dest_image,NULL,80);
?>
실사용법
<img src="thum.php?fn=파일명" alt="" />