Apologies for the long first post. I've been using Imagemagick now for a total of three or four days and through a bunch of trial and error have it doing almost everything I need. Unfortunately I've struck a problem after upgrading to 6.5.3 and 10.6 on Mac OS X*. I had success with the following line (in IM 6.2.x/10.5) performing a fairly agricultural crop of an image submitted from a PHP form.
Code: Select all
system("exec 2>&1; $im_path/convert -colorspace RGB $filename2 -resize '575x575^' -gravity center -extent '575x393' $filename2");
The error appeared to indicate an issue finding the file so I echoed the passed command and copied the resulting string into Terminal where it threw a Permissions Denied error. If I change the image permissions to 0777 the file can now be processed successfully via Terminal. I added a chmod 0777 function to the script but it still fails when I try and run it through PHP. Owner of the file is _www. The only thing I can think of is the Terminal and PHP are running as different users and that's causing the problem (keep in mind I'm not a CLI person per se so this is purely speculation on my part).
I've searched the forums, googled everything you can imagine and spent hours trying everything I can think of. I've not eliminated this being an issue with OSX but the fact it does run from the Terminal tends to indicate a problem with the user running PHP. When searching the forums I did see some mention of changing permission of the sites directory and manually adding virtual hosts but I'm reluctant to do anything manually which Apple could overwrite with an update. I'm not sure whether it's possible to forcibly run IM or the System call as a particular user but I'd be happy to try if someone could point me in the right direction.
Any other assistance or suggestions would be greatly appreciated.
'k
* I upgraded to 10.6 and 6.5.3 as our new XServes will be running this by default and it seemed logical to test on what will be required.