in reply to can't find macro in Image::Magick

You don't want a $ in front of "width". The call should be:     $image->Shave("width"=>$crop_size); where the quotes are optional because of how => works.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: can't find macro in Image::Magick
by Peamasii (Sexton) on Nov 22, 2001 at 00:15 UTC

    Thanks for pointing out a typo ;-) However the problem still occurs:

    $crop_size = int($v - $max_size);
    print "Crop size $crop_size\n";
    $x = $image->Shave(width=>$crop_size);

    Output:

    Crop size 218
    Your vendor has not defined PerlMagick macro main::Shave

    Can't figure it out, because a numeric value works, so do other methods like Crop! Can someone else try it on their systems?

      Note that this error message probably means that AUTOLOAD is being invoked. So one thought I had was that Shave() isn't available in your version of PerlMagick (but you imply that $image->Shave(width=>218) works). I don't understand why it is saying "main::Shave", though...

      After downloading PerlMagick, I see that the "main::" part is just due to some strange code in PerlMagick's AUTOLOAD which I think just needs to be removed. But that has no bearing on your problem.

      So I'm even more convinced that somehow your version of PerlMagick doesn't have a Shave() method and that $image->Shave(width=>218) will not work.

              - tye (but my friends call me "Tye")
        no, unfortunately, this works fine:

        $x = $image->Shave(width=>218);

        That's OK, I can just use Crop and I'll shoot an email to the PerlMagick developer. Thanks for the help!