in reply to Can't call method "scaleY" on an undefined value at C:/strawberry/perl/site/lib/ Image/Seek.pm line 137.

A good thing to check would be whether open returned an error or not.
  • Comment on Re: Can't call method "scaleY" on an undefined value at C:/strawberry/perl/site/lib/ Image/Seek.pm line 137.
  • Download Code

Replies are listed 'Best First'.
Re^2: Can't call method "scaleY" on an undefined value at C:/strawberry/perl/site/lib/ Image/Seek.pm line 137.
by tonyc (Hermit) on Jul 28, 2009 at 04:21 UTC
    I've been considering allowing open (or read, the official name) to be called as a class method instead, to avoid errors like this:
    my $img = Imager->open(file => $foo) or die Imager->errstr;
    It would reduce some of the useless boilerplate Imager->new
      The typical shortcut for
      my $img = Imager->new(); $img->read(...) or ...;
      is
      my $img = Imager->new(...) or ...;
        This doesn't work, same line 137 error returned.
      This
      my $img = Imager->new(); $img->open(file => "photo-1.jpg")or die Imager->errstr;
      Gave me this message:
      Can't locate Imager/File/JPEGReader.pm in @INC (@INC contains: C:/stra +wberry/per l/lib C:/strawberry/perl/site/lib .) at C:/strawberry/perl/site/lib/Im +ager.pm li ne 1538. ...propagated at processimage.pl line 8.
      Which I guess is progress however I don't seem to have JPEGReader.pm and cpan command line does not seem to know about it.

        Did you compile in JPEG support?

        Early in my make output:

        gif: includes not found - libraries not found ungif: includes not found - libraries not found jpeg: includes not found - libraries not found <-- png: includes not found - libraries not found tiff: includes not found - libraries not found freetype2: includes not found - libraries not found freetype2: not available T1-fonts: includes not found - libraries not found TT-fonts: includes not found - libraries not found w32: includes found - libraries found

        So no JPEG support for me.