php 生成缩略图-LMLPHP

  $src = '4.jpg';
  list($width,$height) = getimagesize($src);
  $im = imagecreatefromjpeg($src);
  $panl = imagecreatetruecolor(100, 100);
  imagecopyresampled($panl,$im,0,0,0,0,100,100,$width,$height);
  imagedestroy($im);
  header("content-type:image/jpg");
  imagejpeg($panl);
  imagedestroy($panl);

05-11 18:06