Resize-reduce/thumbnail Images during uploading with ImageMagick

岁酱吖の 提交于 2019-12-25 04:46:06

问题


i have html form to upload images , I want to Resize-reduce/thumbnail during the uploading process.

$uploadDir= "/uploads";
$imageName= $_FILES['image']['name'];
$tempPath = $_FILES['image']['tmp_name'];

move_uploaded_file ($tempPath,$uploadDir);

resize-reduce:

convert $imageName -resize 800x600 -strip -quality 50 -interlace line output.jpg

thumbnail:

convert $imageName -resize x120 -gravity center -crop 120x120+0+0 +repage thumb_output.jpg

this is the first time using Imagick !

thank you


回答1:


run these commands using exec() in background using nohup.

exec('nohup convert ... > /dev/null &');


来源:https://stackoverflow.com/questions/4480331/resize-reduce-thumbnail-images-during-uploading-with-imagemagick

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!