Skeeve has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use GD; use File::Find; my $file= shift; open(my $imgFile, '<', $file ) or die "Can't read $file: $!\n"; binmode $imgFile; my $img= newFromGif GD::Image( $imgFile ); close($imgFile); die "Didn't work" unless defined $img; my ($w, $h)= $img->getBounds(); print $file,": ",$w," x ",$h,"\n";
Unfortunately it fails. Replacing Gif with Png for a png image works fine.
Gif is said to be supported:
gdlib-config --features
GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF
What else can I check to find out what's going wrong here?
Update: Should anyone else stumble across this: I was using gd2 from fink and also gd-pm586 from there. Now I removed gd-pm586 and made my own from CPAN source and it worked!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Solved: GD.pm fails with GIF
by dws (Chancellor) on Apr 08, 2006 at 00:16 UTC | |
by Skeeve (Parson) on Apr 08, 2006 at 06:43 UTC |