0

私は画像をアップロードするためのHTMLフォームを持っています。アップロードプロセス中にサイズを縮小/縮小したいです。

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

move_uploaded_file ($tempPath,$uploadDir);

リサイズ縮小:

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

サムネイル:

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

Imagick を使用するのはこれが初めてです。

ありがとうございました

4

1 に答える 1

1

nohup を使用してバックグラウンドで exec() を使用してこれらのコマンドを実行します。

exec('nohup convert ... > /dev/null &');
于 2011-04-10T19:46:05.883 に答える