Depends on what your ISP provided you.
Do you have commandline access?
What version of IM did they install?
if not then you need to find out about PHP.
Can PHP execute IM commands?
Does it have the MagickWand extension?
Does it have Imagic Pecl extension?
Do they have a simple example of using Im from PHP on their system?
For testing, Does your own machine have IM. A simular version?
Can you do quick commandline tests on your machine?
Basically you need to learn the envionment provided to you.
getting started?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
First 'magic_quotes' is nothing to do with ImageMagick.
I assume you do not have a commandline login on the remote machine.
that is you only somehow upload web files for execution.
So the first thing we need to do is try and find and run the 'convert' command.
Try
upload the PHP and look at it via the web.
This will run three commands to see what is present. If convert on the command PATH, and if so where is it. What version is it, and what font does IM thing it has access to.
If you only see errors, then "convert" is not on the command line path, in which case you will need to find out exactly where it is located and use something like..
If the ISP did there job properly YOU should not need to do this.
If you get "ldd" library errors, the LD_LIBRARY_PATH is wrong, and the ISP has definateally fallen down on the job!
After that try some of the simplier examples from IM Examples and try to get them working. EG: output the IM 'rose' image as a JPEG.
Or try one of the fonts listed from the first test page. On my Solaris Server I see a Utopia font set so I can try...
At this point it is all up to you. NOTE the use of a double slash to 'escape' the return for a multi-line command. and the use of single quotes in the command itself.
I assume you do not have a commandline login on the remote machine.
that is you only somehow upload web files for execution.
So the first thing we need to do is try and find and run the 'convert' command.
Try
Code: Select all
<?
header('Content-Type: text/plain');
system("exec 2>&1; type convert");
system("exec 2>&1; convert -version");
system("exec 2>&1; convert -list type");
?>
This will run three commands to see what is present. If convert on the command PATH, and if so where is it. What version is it, and what font does IM thing it has access to.
If you only see errors, then "convert" is not on the command line path, in which case you will need to find out exactly where it is located and use something like..
Code: Select all
<?
$im_path="/opt/php5extras/ImageMagick/bin"
header('Content-Type: text/plain');
system("exec 2>&1; $im_path/convert -version");
system("exec 2>&1; $im_path/convert -list type");
?>
If you get "ldd" library errors, the LD_LIBRARY_PATH is wrong, and the ISP has definateally fallen down on the job!
After that try some of the simplier examples from IM Examples and try to get them working. EG: output the IM 'rose' image as a JPEG.
Code: Select all
<?
header( 'Content-Type: image/jpeg' );
system("convert rose: jpg:-");
?>
Code: Select all
<?
header('Content-Type: image/gif');
system("convert -pointsize 72 -font Utopia-Italic \\
label:' - Font Test - ' gif:-");
?>
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
This is a very interesting answer Anthony.
Using the first example I can find out the fonts and colours installed etc.
I have never been able to get identify to work but working from your example it now works
Using the first example I can find out the fonts and colours installed etc.
I have never been able to get identify to work but working from your example it now works
Code: Select all
system("exec identify -verbose image.jpg");
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
This is not strictly IM but shell syntax...
In your example, the exec has a different meaning to the way I used it.
Which just map the standard error stearm to standard out for later commands. That way they can be seen.
Replace the current shell interpreter with this command If this is successfully done, no other commands following will work.
So in mine I make sure errors can be seen, while in yours you replace the shell with the identify command.
In your example, the exec has a different meaning to the way I used it.
Code: Select all
exec 2>&1;
Which just map the standard error stearm to standard out for later commands. That way they can be seen.
Code: Select all
exec command ....;
So in mine I make sure errors can be seen, while in yours you replace the shell with the identify command.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/