Page 1 of 1

Simple "Convert" won't work

Posted: 2007-07-16T18:15:20-07:00
by HowBazaar.ca
Somebody please help.

I have the following code in PHP.

----------------------------------------------
if (file_exists('image.jpg')) {
echo 'file exists';
}

exec("usr/local/bin/convert image.jpg image.gif");

if (file_exists('image.gif')) {
echo 'it worked';
} else {
echo 'no you fool, doesnt work';
}
----------------------------------------------

The image resides in the same folder as my code. As you might have guessed, I get the "file exists" and then "doesnt work" message.

What is wrong?

Thanks.

Re: Simple "Convert" won't work

Posted: 2007-07-18T02:14:21-07:00
by fisheggs
Just a guess, but should there be a '/' before the usr in

exec("usr/local/bin/convert image.jpg image.gif");

Re: Simple "Convert" won't work

Posted: 2007-07-18T04:08:15-07:00
by HowBazaar.ca
Thank you fish eggs, that was the problem.