Can"t locate object method "newFromJpeg" via package "GD::Image"
am 19.12.2005 12:03:17 von francescomoiHi.
I'm trying to execute this Perl simple script:
--------
#!/usr/bin/perl
use GD;
my $srcimage = GD::Image->newFromJpeg("image_news.jpg");
my ($srcW,$srcH) = $srcimage->getBounds();
---------
But I get this error message:
-------
Can't locate object method "newFromJpeg" via package "GD::Image" at
../test.pl line 3.
-------
I've got GD and libgd compiled with JPEG support turned on.
1) JPEG libs
+ Downloaded from http://www.ijg.org/files/jpegsrc.v6b.tar.gz
+ mkdir /usr/local/jpeg-6b
+ mkdir /usr/local/jpeg-6b/bin
+ mkdir /usr/local/jpeg-6b/man
+ mkdir /usr/local/jpeg-6b/man/man1
+ mkdir /usr/local/jpeg-6b/incude
+ mkdir /usr/local/jpeg-6b/lib
+ ./configure --prefix=/usr/local/jpeg-6b --enable-shared
+ make
+ make test
+ make install
2) libgd
+ Downloaded from http://www.boutell.com/gd/http/
+ mkdir /usr/local/gd
+ ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg-6b
+ make
+ make install
3) GD-Perl
+ Downloaded from http://search.cpan.org/~lds/GD-2.30/
+ export
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/gd/lib:/usr/local/ zlib/lib:/usr/local/jpeg-6b/lib:$LD_LIBRARY_PATH
+ perl Makefile.PL GD_JPEG -lib_gd_path /usr/local/gd -lib_jpeg_path
/usr/local/jpeg-6b -lib_zlib_path /usr/local/zlib
---------
Included Features: GD_JPEG GD_FREETYPE GD_PNG GD_GIF
GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33
GD library used from: /usr/local/gd
JPEG library used from: /usr/local/jpeg-6b
Zlib library used from: /usr/local/zlib
....
Checking if your kit is complete...
Looks good
Writing Makefile for GD
-----------
+ make
-------------------
...
gcc -c -I/usr/local/zlib/include -I/usr/local/jpeg-6b/include
-I/usr/local/include -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g
-pipe -m32 -march=i386 -mtune=pentium4 -DVERSION=\"2.30\"
-DXS_VERSION=\"2.30\" -fPIC
"-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE" -DHAVE_JPEG
-DHAVE_FT -DHAVE_GIF -DHAVE_PNG -DHAVE_ANIMGIF -DVERSION_33
-DHAVE_UNCLOSEDPOLY -DHAVE_FTCIRCLE GD.c
....
gcc -shared -L/usr/local/lib GD.o -o blib/arch/auto/GD/GD.so
-L/usr/local/zlib/lib -L/usr/local/jpeg-6b/lib -L/usr/local/lib
-L/usr/local/lib -L/usr/local/lib -ljpeg -lfreetype -lpng12 -lz -lm
-lgd
....
Manifying blib/man1/bdf2gdfont.pl.1
Manifying blib/man3/GD::Polyline.3pm
Manifying blib/man3/GD::Image.3pm
Manifying blib/man3/GD::Simple.3pm
Manifying blib/man3/GD.3pm
Manifying blib/man3/GD::Polygon.3pm
--------------------
+ make test
---------------------
All tests successful, 3 subtests skipped.
Files=2, Tests=13, 1 wallclock secs ( 0.22 cusr + 0.03 csys = 0.25
CPU)
--------------------
+ make install
---------------------
Installing
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/ GD/GD.so
Files found in blib/arch: installing files in blib/lib into
architecture dependent library tree
Writing
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/ GD/.packlistAppending
installation info to
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/perllocal.pod
----------------------
Within '/etc/ld.so.conf':
--------
/usr/local/gd/lib
/usr/local/zlib/lib
/usr/local/jpeg-6b/lib
--------
What am I doing wrong? Thank you very much.