PDA

View Full Version : ImageMagick test


nine
03-25-2006, 02:20 PM
Hi, I know BlueHost says ImageMagick is installed, and the convert prgm is at /usr/bin/convert, but could anybody give me a sample code to test it. I can't seem to get it to work. I've tried creating a sample php file:

<?

echo "This is a test";
exec("/usr/bin/convert -background yellow -page 200x50 text:- image.jpg");

?>

but that seems to do nothing. Is there a way I could test it, just to get a start?

Thanks.

nine
03-25-2006, 07:56 PM
Nevermind I got it. When I specified image.jpg, it tried to create the image in /usr/bin/ since that's where convert is, but since I don't have permission to do that, "convert" did not do anything. I had to go back one folder, and then my regular path, so instead of 'image.jpg' it should've been something like '/../{username}/home/public_html/image.jpg'.

Edit: Actually I messed it up a little, instead of '/../{username}/home/public_html/image.jpg', it should be '/../home/{username}/public_html/image.jpg', so if your domain is yourwebsite.com, the path would be something like: '/../home/yourwebs/public_html/image.jpg'.

piku
03-28-2006, 02:36 PM
Thanks for updating. I'm sure this will be useful for other users later on.