开发者

Resize-reduce/thumbnail Images during uploading with ImageMagick

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 u开发者_StackOverflow中文版sing Imagick !

thank you


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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜