Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Lot's of simple question about CGI

by pokemonk (Scribe)
on Jul 21, 2001 at 02:25 UTC ( [id://98578] : note . print w/replies, xml ) Need Help??


in reply to Re: Lot's of simple question about CGI
in thread Lot's of simple question about CGI

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re: Re: Lot's of simple question about CGI

Replies are listed 'Best First'.
Re: Re: Re: Lot's of simple question about CGI
by thpfft (Chaplain) on Jul 21, 2001 at 05:15 UTC

    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.