Image::Size is a library I wrote, based on the wwwimagesize
script by Alex Knowles. I wrote it because I was tired of my CGI scripts
producing HTML pages that were delayed in loading. The delays were simply
due to the lack of HEIGHT and WIDTH attributes
on the image tags. I had to either start hard-coding these into the scripts, or come up with a way to determine image size at run-time.
All versions, alpha and beta releases as well as (hopefully) stable releases will be handled through CPAN, the Comprehensive Perl Archive Network. The current release version is 2.4. You may get it from:
| CPAN Server at the Perl Institute: | Image-Size-2.4.tar.gz |
| Through the CPAN Multiplexer at Perl.COM: | Image-Size-2.4.tar.gz |
Image::Size uses Perl's own MakeMaker facility to build and install. Actual steps taken by the user should be minimal:
zcat Image::Size-2.4.tar.gz | tar xvf - cd Image::Size perl Makefile.PL make make test (assuming all tests pass) make install # may require super-user permissions
I use this almost exclusively in CGI scripts, along with Lincoln Stein's excellent CGI.pm library. A typical call looks somthing like this:
print img(-SRC => 'redball.gif',
-ALT => 'o',
attr_imgsize('/full/path/to/redball.gif'));
The manual page is it's own page: CLICK HERE to view it.