Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Need Mogrify Assistance (PHP)

Need Mogrify Assistance (PHP)
Thread Tools
Junior Member
Join Date: May 2003
Status: Offline
Reply With Quote
Jul 18, 2003, 07:43 PM
 
Hello,

I've got a rather large project due really soon, but I'm having problems executing Mogrify on the server. Here is my code:

[PHP]$cmd = "/usr/pkg/bin/mogrify -scale 150x150 -quality 100 $safe_path";
$exec_output = array();

exec($cmd, $exec_output, $exec_retval);

if ($exec_retval > 0) {
print "ERROR: exec() error: $exec_output[0]";
}[/PHP]

I'm getting the $exec_retval of 1.

Does anyone know what's going wrong? I could REALLY use some help with this.

Thanks!
Jon Marus
www.jmarus.com - kicks by JM
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 18, 2003, 08:58 PM
 
a) is mogrify in /usr/pkg/bin (could you just execute it as mogrify?)
b) is $safe_path the path to an image, or the directory they are in, if it is the directory, if it is the directory do you need to call mogrify on each individual image instead?
c) do you need to specify the type of the images ( ps:image )
d) try this code:
[php]
$erroroutput = `/usr/pkg/bin/mogrify -scale 150x150 -quality 100 $safe_path`;
if ($erroroutput != "") { echo($erroroutput); }
[/php]

(if none of this works, try it one image at a time, i don't know if mogrify will support an entire folder)
--will
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:11 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2