Jump to content


This topic is now archived and is closed to further replies.


How to check if Image Magick is working?

Recommended Posts

Is there something similar to this that I can use to verify that Image Magick is working?

PHP print_r(gd_info());

I have checked and made sure the extensions are enabled in php.ini.

But the script I am running generates a the form, but no image, just the missing image "x". No errors or anything else.

I actually have a variation of the script running that does not use image magick commands and it works fine. Here is the code I am not using, but want to:

[code]# prepare our image magick command
$cmd  = '/usr/bin/convert';
$cmd .= ' -font "'.$font.'"';
$cmd .= ' -fill "#'.$color.'"';
$cmd .= ' -pointsize '.$size;
$cmd .= ' -gravity "'.$gravity.'"';
$cmd .= ' -draw \'text 0,0 "'.$textstr.'"\'';
$cmd .= ' -rotate '.$angle;
$cmd .= ' ./'.$im.' ./images/tmp/'.$tmpname;[/code]

If you cannot tell, I am creating a security image and can do this fine with the script that does not use the image magick. But the security text is flat and this commands above are to twist and angle each alphanumeric to help keep it from being easily picked apart.

Share this post

Link to post
Share on other sites
You could try this:
echo "<pre>"; print_r($out); echo "</pre>";
It should print the instructions on how to use the mogrify command in ImageMagick. (Don't forget the semi-colon on the end of exec() - left out on purpose due to forum bug!)

Share this post

Link to post
Share on other sites
That worked, it printed out:
    [0] => Version: ImageMagick 6.2.8 06/02/06 Q16 http://www.imagemagick.org
    [1] => Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
    [2] =>
    [3] => Usage: mogrify [options ...] file [ [options ...] file ...]
    [4] =>
    [5] => Where options include:

(I snipped the middle of this so it was not a huge post)

    [178] => image type as the filename suffix (i.e. image.ps).  Specify 'file' as
    [179] => '-' for standard input or output.

So, I guess that means it is installed and working correctly and the script is just screwy...lol

I will just have to troubleshoot the script then, probably some pathing issue.

Thanks SemiApocalyptic!

Share this post

Link to post
Share on other sites
Yep, looks like its installed and working! Happy to help [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.