开发者

how can i set imagemagick Path?

asked my Hosting company what is the 开发者_JAVA百科path of imagemagick ?

and they gave me this '/home2/artists5/php'

ok now how can i initiate or exec imagemagick commands on my script?

for example :

i have this form to upload images :

<form action="upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" /><p /><input type="submit" value="Uplaod" />

and this is upload.php:

$uploadDir= "uploads";

$imageName= $_FILES['file']['name'];
$tempPath = $_FILES['file']['tmp_name'];
$error    = $_FILES['fiel']['erroe'];

if ($error > 0 ) 
{
die("Error uploading file! Code $error");
}
else
{
if(move_uploaded_file ($tempPath,$uploadDir."/".$imageName))
   echo $imageName. " has been uploaded!";
}

i want to execute this command while uploaing the image:

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

what should I do ?

i have this question here , but no one answer me ?


Have you tried the exec command? Just include the path to convert in the parameter

eg instead of

exec(' convert ...

use

exec('/home2/artists5/php/convert ...
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜