Wednesday, August 26, 2009

PHP 画像を縮小

<?php


$convert = "/usr/bin/convert";

$image = '/tmp/ssss.jpg';

$newimage = '/tmp/ssss-70x70.jpg';

$option = ' -resize 70x70 ';

exec(escapeshellcmd($convert. ' ' .$option . ' ' .$image. ' ' .$newimage));

chmod ($newimage,0666);
echo "ok";
?>

No comments: