View Full Version : Having problem with PHP & ImageMagick
cyphix
03-27-2005, 06:05 PM
Any ideas why I am not getting any values returned?
// Get image width & height
$cmd = '/usr/local/bin/identify -format "%w x %h"';
$img_wh = system($cmd);
Thanks for any help!
Tangerine Dream
03-27-2005, 06:37 PM
Hi,
The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module.
Returns the last line of the command output on success, and FALSE on failure.
Try passthru() (http://www.php.net/manual/en/function.passthru.php) function:
If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.
cyphix
03-27-2005, 06:47 PM
No luck there either :(
cyphix
03-27-2005, 07:06 PM
lol.. I just realized I should be putting in the image path for the image I want the dimensions on... but I'm not sure where to put them.
Any help on that?
Thanks!
cyphix
03-27-2005, 08:45 PM
Ok.. I have FINALLY got it working after much fiddling around...
system() worked fine.. this is my command line code..
$cmd = '/usr/local/bin/identify -format "%w x %h" ' . $img_path;
:thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.