标签:color img images resize 输出 jpg 调整 ges height
list($width, $height)=getimagesize($filename);
//缩放比例
$per=round(400/$width,3);
$n_w=$width*$per;
$n_h=$height*$per;
$new=imagecreatetruecolor($n_w, $n_h);
$img=imagecreatefromjpeg($filename);
//copy部分图像并调整
imagecopyresized($new, $img,0, 0,0, 0,$n_w, $n_h, $width, $height);
//图像输出新图片、另存为
imagejpeg($new, "a.jpg");
imagedestroy($new);
imagedestroy($img);
标签:color img images resize 输出 jpg 调整 ges height
原文地址:http://www.cnblogs.com/wenxinphp/p/5996168.html