Re: Preloading graphics -Easiest and best way I can think of

by "Michael Gerholdt" <gerholdt(at)ait.fredonia.edu>

 Date:  Sat, 4 Apr 1998 10:40:12 -0500
 To:  "Deborah Rorabaugh" <dandello(at)pacifier.com>,
"hwg-graphics" <hwg-graphics(at)hwg.org>
  todo: View Thread, Original
> 
> 
> 
> Mateo Byler (MTO) wrote:
> 
> > Ok, here's the most obvious, and what I believe the most useful way to
> > preload images.  You'll realize it's so simple you'll probably bang
your
> > head against the computer asking yourself why you were making your life
> > so hard by creating scripts, thinking of browser compatibility's and so
> > on...  This should work perfectly well on any browser:
> >
> > Simply  place the image as a 1x1 pixel inside the html page.  Nobody
> > will see it, it's too small, but it will load.  When your script needs
> > it, your browser has already got it...
> > That is <img src="theimage.gif" WIDTH=1 HEIGHT=1>
> >
> > Mateo Byler

Mateo is wrong when claiming that "This should work perfectly well on any
browser."

The WIDTH and HEIGHT properties are created to assist the browser in laying
out the page before the actual images are downloaded - not to fool it into
forcing the image into dimensions that it does not actually have. While
many browsers will do as Mateo suggests, it is not necessary nor to be
expected that they would. This is bad practice.


> 
> A suggestion: Check out this suggestion in Mosaic 3+. Mosaic has an
annoying
> habit of ignoring the WIDTH and HEIGHT attributes and displays the
graphic
> full size -no matter what. (So much for cross-browser compatability. <G>)
> Personally, I have had nasty surprises from this property and now use it
to
> test out thumbnails to make sure I actually reduced the graphic properly.
> If you don't have Mosaic, you can download it from Tucows.
> 
> Deborah R




To call Mosaic's display of an image in its true dimensions regardless of
specified dimensions an "annoying habit" misses the point, as well.

What Mosaic is doing is perfectly permissable and proper. Just because
other browsers "bend" to our requests for image-cramming does not mean:
	1) that it is proper HTML practice
	2) that browsers which do not are somehow sub-standard or deficient

The solution to preloading graphics in this manner is a hack that may work
widely, but not because it's good and right.

This is simply fact, not flame; no offense intended to anyone.

Best Regards,

Michael Gerholdt

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA