脚本宝典收集整理的这篇文章主要介绍了php – 如何将图像移动到新文件夹?,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$in_filename = '4csrWqu9ngv.jpg'; list($width,$height) = getimagesize($in_filename); $offset_x = 0; $offset_y = 0; $new_height = $height - 65; $new_width = $width; $image = imagecreatefromjPEg($in_filename); $new_image = imagecreatetruecolor($new_width,$new_height); imagecopy($new_image,$image,$offset_x,$offset_y,$width,$height); header('Content-type: image/jpeg'); imagejpeg($new_image); $move_new = imagejpeg($new_image); rename($move_new,'new/' . $move_new);
一如既往的任何帮助表示赞赏:)
固定代码:
$in_filename = '4csrWqu9ngv.jpg'; list($width,$height) = getimagesize($in_filename); $offset_x = 0; $offset_y = 0; $new_height = $height - 65; $new_width = $width; $image = imagecreateFromjpeg($in_filename); $new_image = imagecreatetruecolor($new_width,$height); /* Uncomment in case you want IT also outputted header('Content-Type: image/jpeg'); imagejpeg($new_image); */ imagejpeg($new_image,$in_filename); rename($in_filename,'new/' . $in_filename);
以上是脚本宝典为你收集整理的php – 如何将图像移动到新文件夹?全部内容,希望文章能够帮你解决php – 如何将图像移动到新文件夹?所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。