unable to call class function

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
vurentjie

unable to call class function

Post by vurentjie »

hi,

still quite new to this, and not really sure if my installation has been totally successful,

i have been playing around a bit with imagick, and while i get some of the cmd line stuff working on my machine i can't seem to call imagick_create();

from reading some of the online stuff i got something like the following working

Code: Select all

$cmd =  "convert -size 150x300 \"$photo\"".
" -resize 200x200" .
" -strip" .
" -unsharp 0.2x0.6+1.0" .
" -quality 70 JPG:-";
header("Content-type: image/jpg");
passthru($cmd, $retval);
however now i wanted to try use API calls like imagick_create();but this will not be found,?

in my phpinfo it tell me imagick is enabled, and i have enabled .dll in my .ini file, so kinda stuck, i am going to go check out my install and stuff again, but any help is appreciated, WINDOWS XP os,?!?!
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: unable to call class function

Post by Bonzo »

Imagick is an API? for imagemagick. Your example code posted is using the command line and php.

I do not use Imagick but as far as I know it should show up in your php.ini file.

This should display the Imagemagick version installed:

Code: Select all

<?php
echo "<pre>";
system("convert -version");  
echo "</pre>";
?> 
As I say I do not use Imagick but this should resize and display an image without saving it to prove it will work:

Code: Select all

<?php  
header("Content-type: image/jpeg"); 
$image = new Imagick("input.jpg"); 
$image->thumbnailImage(100, 0); 
echo $image; 
?> 
Also there is a seperate part of the forum for Imagick problems - see the main page.
vurentjie

Re: unable to call class function

Post by vurentjie »

thank you, yes maybe my terminology a bit out, as i say very new still,
i just realize i need to go recheck some stuff, anyway thanks
vurentjie

Re: unable to call class function

Post by vurentjie »

ok, so yes a bit silly of me imagick....is not imagemagick.

so using the cmd line is pretty ok for me, i can understand it.

just some queries basically.
my web server has (is?) enabling/installing imagemagick for me, i am the first to have this done by them - so i am sure they are a bit in the dark as well. from what i think i understand my site/priviliges needs to have some settings specified if i am going to be using cmds like exec and passthru? is this correct. so using these would not work if i was running in a safe mode? how big is the security risk....

thanks
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: unable to call class function

Post by Bonzo »

The name Imagick is causing some confusion; I do not know why they decided to use it.

My hosts installed it for me so I do not know about permissions etc. I am on a unix server and as you say safe mode needs to be off. Any folders you are writting to need to be CHMOD 777 unless your host is using phpsusex ? and then they need to be 755.
If you are letting users upload images make sure you sanitise their input and you will have to search google for any other info on safe mode.

Check out my site for more info examples of IM with php.
Post Reply