Hi all,
I am a newbie in Imagemagick. I tried to convert an jpg image to png using this PHP script
exec('/usr/local/lib/ImageMagick/convert -convert grass.jpg grass.png', $report);
print_r($report);
My hosting providers told me that the path to Imagemagick is /usr/local/lib/ImageMagick
I think, it is because I have used the wrong command or command is wrong,
Thanking you for any help...
ImageMagick Path Problem
Re: ImageMagick Path Problem
You will be better off posting this sort of question in the users section as this section is for Imagick.
Try these to confirm what you have:
Your code is incorrect ( I can get away with just convert and not /usr/local/lib/ImageMagick/convert ):
Try these to confirm what you have:
Code: Select all
<?php
echo "<pre>";
system("type convert");
echo "</pre>";
?>
OR
<?php
echo "<pre>";
system('which convert',$path); print_r($path);
echo "</pre>";
?>
Version
<?php
echo "<pre>";
system("convert -version");
echo "</pre>";
?>
Code: Select all
exec('/usr/local/lib/ImageMagick/convert grass.jpg grass.png', $report);
print_r($report);
Re: ImageMagick Path Problem
Thank you very much for your support, and sorry for posting this here. I figured out that my path was incorrect. What went wrong was the foolish service provider told me the wrong path. And my command was also incorrect. Actually after getting the correct path, the problem solved. Thank you very much for your support once again
Re: ImageMagick Path Problem
I am glad its sorted now; for some more php examples tips etc. take a look at my site.
For your information Imagick is an API? that is built into php 5 like GD whereas ImageMagick is an external program called from php.
For your information Imagick is an API? that is built into php 5 like GD whereas ImageMagick is an external program called from php.