(none) imager-devel
/ help / lists / applications / search /
 

Re: Imager functionality

From: Tom Cresap (
09920@xyz.molar.is)
Date: Tue 08 Jul 2003 - 22:52:36 GMT

  • Next message: Tony Cook: "Re: Re: Imager functionality"

    Howdy. I am trying to get Imager working on a RedHat Linux box, and I
    keep getting the following error message when I run the demo file from
    the CPAN site where I got the Imager.pm code.

    #perl thumb.pl picture

    Can't locate loadable object for module Imager in @INC (@INC contains:
    /usr/local/lib/perl5/5.8.0/i686-linux /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .)
    at /usr/local/lib/perl5/5.8.0/i686-linux/DynaLoader.pm line 153
    BEGIN failed--compilation aborted at
    /usr/local/lib/perl5/5.8.0/i686-linux/Imager.pm line 153.
    Compilation failed in require at thumb.pl line 5.
    BEGIN failed--compilation aborted at thumb.pl line 5.

    I am pretty sure that I have all the required modules, and that they are
    in the @INC path, and when I check the Imager and DynaLoader files there
    doesn't seem to be any relevant code at line 153. This is a new perl
    5.8 install that is working correctly. Do you have an idea of what
    Imager-module-object can't be located? Or some other reason that this
    error in occuring? I am including the code for the CPAN demo program
    just in case it may be useful in problem solving. Thanks for your help.
     Tom

      # Thumbnail example

      #!/usr/bin/perl -w
      use strict;
      use Imager;

      die "Usage: thumbmake.pl filename\n" if !-f $ARGV[0];
      my $file = shift;

      my $format;

      my $img = Imager->new();
      $img->open(file=>$file) or die $img->errstr();

      $file =~ s/\.[^.]*$//;

      # Create smaller version
      my $thumb = $img->scale(scalefactor=>.3);

      # Autostretch individual channels
      $thumb->filter(type=>'autolevels');

      # try to save in one of these formats
      SAVE:

      for $format ( qw( png gif jpg tiff ppm ) ) {
        # Check if given format is supported
        if ($Imager::formats{$format}) {
          $file.="_low.$format";
          print "Storing image as: $file\n";
          $thumb->write(file=>$file) or
            die $thumb->errstr;
          last SAVE;
        }
      }



  •