Jump to content

How to check if Image Magick is working?


freakus_maximus

Recommended Posts

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

[code]<?
PHP print_r(gd_info());
?>[/code]

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.
Link to comment
Share on other sites

You could try this:
[code]<?php
exec("mogrify",$out)
echo "<pre>"; print_r($out); echo "</pre>";
?>[/code]
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!)
Link to comment
Share on other sites

That worked, it printed out:
[code]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.
)[/code]

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!
Link to comment
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\" /]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.