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.