脚本宝典收集整理的这篇文章主要介绍了保存图像使用PHP调整大小,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
<?PHP // The file $filename = 'test.jpg'; $PErcent = 0.5; // Content type header('Content-type: image/jpeg'); // Get new dimensions list($width,$height) = getimagesize($filename); $new_width = $width * $percent; $new_height = $height * $percent; // Resample $image_p = imagecreatetruecolor($new_width,$new_height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p,$image,$new_width,$new_height,$width,$height); // Output imagejpeg($image_p,null,100); ?>
我的问题是,如何保存这个已调整大小的图像?我需要吗?有没有办法操纵调整大小的图像而不保存它?
以上是脚本宝典为你收集整理的保存图像使用PHP调整大小全部内容,希望文章能够帮你解决保存图像使用PHP调整大小所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。