| | |
|
|
|
How important are IMG size attributes these days? |
| message from darrel on 16 Jul 2004 |
In the past, It was always fairly important to make sure you explicitely put
in size attributes for your images so that the page could render before the
image was fully loaded.
Is that still an issue these days, or do most browser render on the fly (in
the past, you often had to wait for all the conent in a table to load before
the table would render, so if you put in an image's size, it could 'reserve'
that spot.
The reason I ask:
I'm working on a .net component for our CMS that lets an end user upload an
image. I then size this image into different sizes like this:
800 pixels (full size)
400 pixels (regular)
100 pixels (thumbnail)
Now, the catch is that I can not guarantee that the image will be larger
than 800 pixels to begin with. So, if they upload a 600 pixel image, I'm not
going to upsize it to 800.
So, what to do on the front end?
I see two options:
1) Grab the image in the folder and just let the browser render it as-is
2) Grab the images width/height attributes on the server side (via .net) and
then send that to the browser to write out the IMG tag with the correct
width/height.
My question, I guess, is there really any performance difference between #1
and #2? #1 would obviously be a lot easier to develop on my end.
-Darrel
|
| cmbergin replied to darrel on 16 Jul 2004 |
The most irritating thing about size attributes is when they're wrong and the
image is streched out or compressed.
Other than that, the content will still render before the image is done
downloading, but it will shift and shuffle every time the next image's size
attributes are retrieved. It's pretty irritating when you're reading and the
paragraph jumps down 100 pixels because the browser started retrieving an image
above the paragraph you're reading. Pretty much only an issue on dialup unless
the images are huge.
|
| darrel replied to cmbergin on 16 Jul 2004 |
Ah yes...good point. Very good point, actually.
OK, well, I think that answers the question...they still are quite
important. I'll grab the image size on the server side and then write out
the HTML that way.
-Darrel
|
|
Archived message: How important are IMG size attributes these days? (Macromedia Dreamweaver)