问题
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