PHPGD库处理JPG图片大小变模糊的解决办法
时间:2021-07-01 10:21:17
帮助过:22人阅读
header("Content-type: image/png"); $temp_width = 150; - $temp_height = 180;
$img_path = "test.jpg"; - $img_path2 = "test2.jpg";
$im = @imagecreatefromjpeg($img_path); $temp_img=imagecreatetruecolor($temp_width,$temp_height); - imagecopyresampled($temp_img,$im,0,0,0,0,$temp_width,$temp_height,$temp_width,$temp_height);
- //echo $temp_img;
- //imagejpeg($temp_img);
- imagepng($im,$img_path2);
/* - imagecopyresized($temp_img,$im,0,0,0,0,$temp_width,$temp_height,$srcW,$srcH);
- $ni=imagecreatetruecolor($width,$height);
- imagecopyresampled
- $res = function_exists('imagecreatetruecolor');
- var_dump($res);
- */
- ?>
|