lnl has asked for the wisdom of the Perl Monks concerning the following question:

Greeting,

I've been trying to use GD::Image...

I keep getting

"Can't locate object method 'newFromJpeg' via package 'GD::Image' at / +www/cgi-bin/imager.pl line 678, <TEMP> chunk 10."

Line 678 is:

$t_SrcImg= GD::Image->newFromJpeg("$imagedir/$file");
Also tried:
$t_SrcImg = newFromJpeg GD::Image("$imagedir/$file");

Tried including GD.pm in a BEGIN followed by import, but no effect.

Hints will lift my spirits.

lnl

Edit 2001-06-16 ar0n -- Changed title to a more descriptive one

Replies are listed 'Best First'.
Re: Dumb question #1 - GD
by bikeNomad (Priest) on Jun 04, 2001 at 08:09 UTC
    The GD library can be compiled with or without JPEG, XPM, PNG, Freetype, etc.

    Likewise for the GD module (which has some config options when you compile it.

    The config script asks for JPEG, Freetype, and XPM support options; if you didn't answer yes for the JPEG, you don't get support.

    Anyway, does this work? (provide your own JPEG filename):

    use strict; use GD; my $img = GD::Image->newFromJpeg("/home/ned/Champagne.jpg");
      bikeNomad:

      No, it does not work (same error)
      Does it sound like the GD library was compiled without JPEG?

      This was not my doing... I am using a hosting service with a large set of modules pre-installed.
      This would not be the first time...