Jump to content


Photo

How to check if Image Magick is working?


  • Please log in to reply
3 replies to this topic

#1 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 21 June 2006 - 04:42 PM

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:

# 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;

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.

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 21 June 2006 - 06:17 PM

You could try this:
<?php
exec("mogrify",$out)
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!)

#3 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 21 June 2006 - 06:42 PM

That worked, it printed out:
Array
(
    [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!

#4 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 21 June 2006 - 07:41 PM

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\" /]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users