Forum Moderators: coopster

Message Too Old, No Replies

Accessing ImageMagick Binaries

Help me translate this support response . . . . .

         

rocknbil

2:22 am on Feb 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use ImageMagick, a lot. In PHP, with Imagick, like

<?php
header("content-type:text/html");
$img_path = '/path/to/some/file.gif';
$image = new Imagick($img_path);
$w = $image->getImageWidth();
$h = $image->getImageHeight();
echo "W $w height $h ";
?>

Or in Perl:

#!/usr/bin/perl
print "content-type:text/html\n\n";
use Image::Magick;
$img_path = /path/to/some/file.gif';
$pic = Image::Magick->new;
$x =$pic->Read("$img_path");
$height=$pic->GetAttribute('height');
$width= $pic->GetAttribute('width');
print "width $width height $height";

The problem: Client is on shared hosting. The perl solution works, proving the ImageMagick Binaries are functional, and the perl modules are installed.

But there's no Imagick. Gives "Class cannot be found." In trying to sort this out with support, this is the response I get:

You need to add /usr/bin/convert in $img_path


I have **no idea** what this means. And neither does he.

So clues, please? If I had access to the command line this would be done, I'd just install Imagick. Anyone got any ideas on this one?

Client requested PHP, I really don't want to rebuild it in Perl, or stoop to an exec just for this function.

jatar_k

2:22 pm on Feb 17, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



have you looked at phMagick, it seems to be a class and it says it just uses imagemagick, I found it on the imagemagick.org site but I can't find what might need to be installed, I assume just the binaries from the wording

aside from that I am really not sure

rocknbil

7:00 pm on Feb 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah, and MagicWand as well. :-) They all require installation, which is not possible in this shared environment.

The issue is resolved, the host installed Imagick and I was amazed at the speed at which they addressed it - but can't let it go, I wonder what the heck they were talking about. Add the path . . . to WHAT? I am thinking they might have meant running an exec command along that path, which could work . . but it's just not very graceful.

jatar_k

7:13 pm on Feb 17, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



all i can find are exec examples so I assume that's what was meant