Page 1 of 1

[SOLVED] How to find a list of methods(?)/operations in my version of Image::Magick?

Posted: 2019-09-18T11:55:15-07:00
by E. Fudd Wabbitwy
I've been scratching out a Perl program using the Image::Magick module and have been proceeding, essentially, by finding and adapting small examples.

I'm running Perl5 on Ubuntu 18.04, and I believe my I::M module is ($image->Get('version')):
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114

Most recently, I tried to call a SetPixels() method, only to be informed:
"Can't locate auto/Image/Magick/SetPixels.al in @INC"

My questions:
1. How, inside a Perl/.pl script, to ask Image::Magick to display its list of accessible methods?
2. How, outside of Perl scripts, to find the I::M module (or related--something about "autoloading"?) and search it for a list of public methods?
and, I guess,
3. How can I get SetPixels() in my setup?

Thank you.

Re: How to find a list of methods(?)/operations in my version of Image::Magick?

Posted: 2019-09-18T12:04:28-07:00
by fmw42
I do not use PerlMagick, but have you seen https://imagemagick.org/script/perl-magick.php

Re: How to find a list of methods(?)/operations in my version of Image::Magick?

Posted: 2019-09-18T12:19:09-07:00
by E. Fudd Wabbitwy
Indeed, yes. It was the mention of SetPixels() on that page which inspired my attempt to use it.

And, yes, I acknowledge that that page is, itself, a listing of accessible methods. However, in my case, at least some of them remain theoretical, and my goal is to ask the installed version of Image::Magic (aka PerlMagick) what it has, or to find out for myself by finding the Perl module (.pm file) and reading for myself.

Thanks!

Re: I How to find a list of methods(?)/operations in my version of Image::Magick?

Posted: 2019-09-19T10:07:29-07:00
by E. Fudd Wabbitwy
My goal was to try to find out WHAT methods were available. In particular, I discovered that "setpixels" (plural) is not available in my setup, leading me to trying to install the latest version from source.

This works:

Code: Select all

use Class::Inspector;
use Image::Magick;

my $arrayref=Class::Inspector->methods('Image::Magick','full','public');
for (my $i=1;$i<=$#{$arrayref};$i++) {
print $#{$arrayref};
  print "$arrayref->[$i]\n";
}
exit;