Can anyone explain some of the mysteries of ImageMagick scripting with Perl?

I installed the ImageMagick package found here:

  http://www.entropy.ch/software/macosx/welcome.html#imagemagick

and it says it installed OK, although I can't do "mogrify -args file" I have to do "/usr/local/bin/mogrify -args file"

Then I go to install the perl Image::Magick module from CPAN, which fails with hundreds of lines of errors which look like they relate to the Magick.xs and Magick.c files:

  Magick.xs:177: warning: no semicolon at end of struct or union
  Magick.xs:181: warning: data definition has no type or storage class
  Magick.xs:182: error: parse error before '}' token

and I notice that I'm installing not actually Image::Magick but something called PerlMagick, although I have installed a module called Image::Magick but it doesn't actually work when called, i.e. when I run this:

  $image->Read('pic.jpg');

it returns the error "can't open file `'".

One further mystery is that the Image::Magick module doesn't seem to work like a regular Perl module at all. I'm told, on this page:

  http://www.imagemagick.org/script/perl-magick.php

to use it like this:

  $x = $image->Crop(geometry=>'100x100"+100"+100');
  warn "$x" if "$x";

rather than what I expect:

 $image->Crop(geometry=>'100x100"+100"+100') or die "$!";

so, what's the point of a Perl module which doesn't work like Perl? I might as well be doing everything using system() calls and checking the return values. And what is PerlMagick? Is it a binary containing the same code as ImageMagick or just an interface to it?

So, I'd appreciate any answers to the above mysteries, but of course what I want to do is edit images with Perl -- if there are other ways to do it or other libraries I can use, TIA.









Reply via email to