Dear ImageMagick,
I am trying to use imagemagick from PHP, but I haven't been really succesful for half a year already. Some commands simply do not work. Others do. From shell (SSH) all command work, safe mode is disabled, magic quotes are off.
Today I upgraded to the latest version 6.4.3.10, and still it does not work for example with the following command:
exec(" convert -size 50x80 xc: +noise Random -write mpr:rand -extent 100x80 -page +50-40 mpr:rand -page +50+40 mpr:rand -flatten __FULL_PATH__/pc_tmp/hextile.jpg ")
What could be the problem?
Thanks in advance for your help.
Best Regards,
SEO
ImageMagick not working completely in PHP (only from shell)
Re: ImageMagick not working completely in PHP (only from shell)
This is the error: convert: UnrecognizedNoiseType `Random'.
In shell however, this error is not returned and the command is processed fine.
exec(" convert -size 50x80 xc: +noise Random -write mpr:rand -extent 100x80 -page +50-40 mpr:rand -page +50+40 mpr:rand -flatten __FULL_PATH__/pc_tmp/hextile.jpg ")
In shell however, this error is not returned and the command is processed fine.
exec(" convert -size 50x80 xc: +noise Random -write mpr:rand -extent 100x80 -page +50-40 mpr:rand -page +50+40 mpr:rand -flatten __FULL_PATH__/pc_tmp/hextile.jpg ")
Re: ImageMagick not working completely in PHP (only from shell)
You could have two versions installed.
Try convert -version in shell and run this php code:
Try convert -version in shell and run this php code:
Code: Select all
<?php
system("convert -version");
?>
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ImageMagick not working completely in PHP (only from shell)
I am not a PHP IM person and admit that I am puzzled by your command as I cannot figure out what you are trying to do. You seem to be writing to the same mpr: image over and over. I would have expected that you would be writing each change to a different mpr: image, e.g. mpr:rand1, mpr:rand2, mpr:rand3 etc and then flattening your images. Perhaps you can explain what you are trying to do.
If you are trying to get different random patterns, you can use -seed to change the seed value for the random number generation.
Also perhaps Random is being misinterpreted by the exec or PHP as a shell operation and not an IM function????
I don't know if this is relevant, but try 'Random' with quotes???
If you are trying to get different random patterns, you can use -seed to change the seed value for the random number generation.
Also perhaps Random is being misinterpreted by the exec or PHP as a shell operation and not an IM function????
I don't know if this is relevant, but try 'Random' with quotes???
Re: ImageMagick not working completely in PHP (only from shell)
Hi there!
Thank you for your replies.
http://www.imagemagick.org/Usage/backgrounds/
I will have my host take a look at it.
Thanks a lot for the support!
Best Regards,
Jan Jaap
Thank you for your replies.
This is just a standard IM command I found in the usage documentation (see image), it also does not work with simple label:'text' commands. However, resizing would work, just not with the latest flags.Also perhaps Random is being misinterpreted by the exec or PHP as a shell operation and not an IM function????
I don't know if this is relevant, but try 'Random' with quotes???
http://www.imagemagick.org/Usage/backgrounds/
Yes, you were right. It returned: Version: ImageMagick 6.3.3 04/19/07 Q16 file:///usr/share/doc/ImageMagick-6.3.3/index.html Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLCYou could have two versions installed.
I will have my host take a look at it.
Thanks a lot for the support!
Best Regards,
Jan Jaap