Hi fellow monks! I just started to use GD.pm. I wrote this little script to check a GIF's dimensions
#!/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!
s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.