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

I'm a newbie trying to write a subroutine that will return the height and width of a picture file (in different formats though.. jpegs/gifs and bmps... ) Is this very difficult to do in perl or not?? Please help.. thanks in advance

Replies are listed 'Best First'.
Re: Image sizes?? (width and height)
by Ugly (Beadle) on Aug 10, 2000 at 14:32 UTC
    The hard work has already been done for you here, check out the Image::Size module on CPAN.
    use Image::Size; ($x, $y) = imgsize("mypic.gif");
    Will give you the x and y dimensions of your picture. It works with a wide range of different image formats and sources. It's a very handy module indeed.

    Ugly