Fred's cylinderize problem from php

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
indusglyphs

Fred's cylinderize problem from php

Post by indusglyphs »

Hi,

I have successfully run "cylinderize -m vertical -v background -b none -p 20 -t test.jpg test2.png" from my Fedora 10 command line, but once i tried to run the same using php i.e. exec('cylinderize -m vertical -v background -b none -p 20 -t test.jpg test2.png') it gives me this error
--- FILE test.jpg NOT READABLE OR HAS ZERO SIZE Rajesh---

Could someone please help me?

Warm regards
Rajesh
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fred's cylinderize problem from php

Post by fmw42 »

1) provide the full path to cylinderize in your exec command and possibly full paths to images (this may or may not be necessary)
2) edit the cylinderize script to provide the full path to convert (PHP does not always recognize the system PATH)
3) edit the cylinderize script to change dir="." to dir="/tmp" (possibly a permission issus)

If that does not work, contact me at fmw at alink dot net.

User Bonzo may also have some other suggestions as he has recently gone through the same.

Fred


PS I think you posted this to the wrong forum. Probably should be Users forum
indusglyphs

Re: Fred's cylinderize problem from php

Post by indusglyphs »

Hi Fred,

Using convert -version i got /usr/bin thus i have change your cylinderize shell script and converted the command "convert" to "/usr/bin/convert" and also change my exec command to
echo exec('bash /var/www/html/mug/cylinderize -m vertical -v background -b none -p 20 -t /var/www/html/mug/test.jpg /var/www/html/mug/test2.png');

I have tested with "bash" and without bash.

But the funny thing after i added "/usr/bin" into your script now it is also not working from commadn line as well. It gives me errors like
convert: Improper image header `./cylinderize_6384.mpc'.
convert: missing an image filename `./cylinderize_6384.mpc'.
convert: Improper image header `./cylinderize_6384.mpc'.
convert: missing an image filename `test2.png'.

and didn't create test2.png.

I have also tried with /tmp but no luck.

Could you please help me on this.
indusglyphs

Re: Fred's cylinderize problem from php

Post by indusglyphs »

Hi Fred,

Sorry the commadn was "whereis convert" not "convert -version"

Regards
rajesh
indusglyphs

Re: Fred's cylinderize problem from php

Post by indusglyphs »

Hi Fred,

I think it is working right now. I did a small mistake. In your script there are other functions in image magick and i changed only "convert" command.

Thank you very much
warm Regards
Rajesh
Post Reply