Page 1 of 1

get not working?

Posted: 2009-10-09T06:39:13-07:00
by wpns
From http://www.imagemagick.org/script/perl- ... -attribute I'm trying to use ->Get( but only get the error message:

Can't locate object method "Get" via package "Exception 410: unrecognized option `metric'" (perhaps you forgot to load "Exception 410: unrecognized option `metric'"?)

I've even tried the sample program:
use Image::Magick;

$logo=Image::Magick->New();
$logo->Read('logo:');
$sharp=Image::Magick->New();
$sharp->Read('logo:');
$sharp->Sharpen('0x1');
$difference=$logo->Compare(image=>$sharp, metric=>'rmse');
print $difference->Get('error'), "\n";

and get the same error.

I'm running ImageMagick 6.2.8.0-4 and the associated ImageMagick-perl-6.2.8.0-4, is ->Get( supposed to be in there?

Thanks!

Re: get not working?

Posted: 2009-10-09T07:48:42-07:00
by magick
Upgrade! The current version of ImageMagick is 6.5.6-9. We tried your script and got:
  • -> perl compare.pl
    0.0235200130334416

Re: get not working?

Posted: 2009-10-09T08:16:55-07:00
by wpns
That was my first thought, but I can't find perlmagick-6.5.6 anywhere.
http://www.imagemagick.org/script/perl-magick.php says it's at
http://www.imagemagick.org/script/download.php but
ftp://ftp.imagemagick.org/pub/ImageMagick/ only has
a /perl/ subdirectory, which has
ftp://ftp.imagemagick.org/pub/ImageMagi ... .53.tar.gz in it

Is that the right place, or right file at all?

Also, there are instructions to:

/*
Next, edit Makefile.PL and change LIBS and INC to include the appropriate path information to the required MagickCore library. You may need paths to JPEG, PNG, TIFF, etc. delegates if they were included with your installed version of ImageMagick.
*/

I don't know how to do this at all?

[I'm running those old versions because there were RPMs I could install on my Centos system...]

Thanks!

Re: get not working?

Posted: 2009-10-09T08:33:37-07:00
by magick
Try upgrading from source, it include PerlMagick. Type
  • tar xvfz ImageMagick-6.5.6-9.tar.gz
    cd ImageMagick-6.5.6-9
    ./configure
    make
    make install
    cd PerlMagick
    perl Makefile.PL
    make install

Re: get not working?

Posted: 2009-10-09T10:22:39-07:00
by wpns
That did it, many thanks!

[now to see how much faster PerlMagick is than calling Magick functions using system calls.]