You need the height and width in order to be able to display the image efficiently in an html page, and really you need some alt text for the same reason.
You could use GD to read the image each time you put it on a page, but it would be absurdly inefficient. That information isn't going to change until the image changes, so why not just read it once and remember it for later? That's what the height and width fields are for.
The best way to get at the dimensions is to run the filehandle that CGI.pm creates past the Image::Size module. Merlyn has written a column about this, of course. It deals with a different task, but the principle is the same.
|