Page 1 of 1

ImagiMagick simple testing script

Posted: 2009-04-03T05:49:57-07:00
by Glostar
I bought a webhost from hosting provider. But ImageMagick does not work. Hosting provider said ImageMagick is installed.

But ImageMagick still do not work! I think it is not installed properly :(

So, I need any simple test script to test ImageMagick if it works or not. I need real visual evidence for hosting provider to tell him that Imagimagick is not properly installed. I looked through this site but didn't see any test script.

Please give me any recommendation and testing script(s).

Re: ImagiMagick simple testing script

Posted: 2009-04-03T12:33:49-07:00
by fmw42
First see if one of these works:

<?php
system("/usr/local/bin/convert -version");
?>

<?php
$IM_version=shell_exec("/usr/local/bin/convert -version");
echo $IM_version
?>

<?php
exec("/usr/local/bin/convert -version",$out,$returnval);
print_r($out[0]);
?>


You may have to change the path to wherever your host has IM. Another path might be /user/bin/convert.

Re: ImagiMagick simple testing script

Posted: 2009-04-05T09:19:11-07:00
by Glostar
fmw42 wrote:First see if one of these works:

<?php
system("/usr/local/bin/convert -version");
?>

<?php
$IM_version=shell_exec("/usr/local/bin/convert -version");
echo $IM_version
?>

<?php
exec("/usr/local/bin/convert -version",$out,$returnval);
print_r($out[0]);
?>


You may have to change the path to wherever your host has IM. Another path might be /user/bin/convert.
these 3 code gives:

1.
Version: ImageMagick 6.5.1-0 2009-04-03 Q16 OpenMP http://www.imagemagick.org Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

2.
Version: ImageMagick 6.5.1-0 2009-04-03 Q16 OpenMP http://www.imagemagick.org Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

3.
Version: ImageMagick 6.5.1-0 2009-04-03 Q16 OpenMP http://www.imagemagick.org

I KNOW that ImageMagick IS INSTALLED but It do NOT work, I have tested with two my scripts. It do not show image at registration page with image verification.

I need any ImageMagick simple testing script,

Re: ImagiMagick simple testing script

Posted: 2009-04-05T09:59:04-07:00
by Bonzo
This code will give you the path to ImageMagick:

Code: Select all

<?php
echo "<pre>";
system("type convert"); 
echo "</pre>";
?> 
I can run my code with just convert but depending on the setup you may need to use /usr/local/bin/convert - depending what the code above displays.

A simple script:

Code: Select all

<?php
// Replace input.jpg with the name of a jpg image in the same folder as this code and run it.
exec("convert input.jpg -thumbnail 50x50 output.jpg");
?>
<img src="output.jpg">

Re: ImagiMagick simple testing script

Posted: 2009-04-06T04:12:06-07:00
by Glostar
I did this test, but ImageMagick do not work still.

Code: Select all

<?php
echo "<pre>";
system("type convert"); 
echo "</pre>";
?> 
the bove code gives the path /usr/local/bin/convert
please see here http://www.aba10.com/mmdir/image_magick ... Magick.php

Code: Select all

<?php
// Replace input.jpg with the name of a jpg image in the same folder as this code and run it.
exec("convert input.jpg -thumbnail 50x50 output.jpg");
?>
<img src="output.jpg">
the above code does not convert image input.jpg into output.jpg
please see here
http://www.aba10.com/mmdir/image_magick ... e-test.php
the directory http://www.aba10.com/mmdir/image_magick_test/IM-Forum2/

Re: ImagiMagick simple testing script

Posted: 2009-04-06T05:08:04-07:00
by Bonzo
You could try this and see if you get any errors, if it still does not work I would contact your hosts.

Code: Select all

<?php

echo "Using convert:<br>";
$array = array();
echo "<pre>";
// Replace input.jpg with the name of a jpg image in the same folder as this code and run it.
exec("convert input.jpg -thumbnail 50x50 output1.jpg 2>&1", $array);
print_r( $array );
echo"</pre>";

echo "Using /usr/local/bin/convert:<br>";
$array = array();
echo "<pre>";
// Replace input.jpg with the name of a jpg image in the same folder as this code and run it.
exec("/usr/local/bin/convert input.jpg -thumbnail 50x50 output2.jpg 2>&1", $array);
print_r( $array );
echo"</pre>";

?>
<img src="output1.jpg"><br>
<img src="output2.jpg">

Re: ImagiMagick simple testing script

Posted: 2009-04-06T06:01:10-07:00
by Glostar
ImageMagick do not work still, I got error, please see here http://www.aba10.com/mmdir/image_magick ... t-test.php
and directory is here http://www.aba10.com/mmdir/image_magick_test/IM-Forum2/

I am with contact of hosting provider many days about ImageMagick problem. They reinstalled ImageMagick many times, but They cannot managed to settle the problem. They do not know what to do :(

Re: ImagiMagick simple testing script

Posted: 2009-04-06T07:24:40-07:00
by Bonzo
Have you CHMOD your dirctory you are saving the image in to 777 or 755 ?