5 Aug 2003
Could someone tell me why height and width attributes are needed for images? Non-graphic browsers don’t use them, and graphic browsers should be smart enough to figure out the size on their own. The first few bytes of common image formats contain the image’s size, so the browser doesn’t even need to download the whole image.
It’s silly to require people to add metadata to HTML when that metadata is something easily calculated by the computer. That’s what we have computers for: to reduce the amount of manual work. Most authoring tools can automatically add the attributes, but the work’s still be done on the wrong end. This shouldn’t be an authoring function, it should be a rendering function.
Did anyone found the program to add dimentions to height and width as mentioned in this comments? I would be very interested in getting such script, thanks
I like AK’s idea of “how can we make the technology better”. It’s surprisingly hard to think laterally or differently!
Now about Andrew Clover’s suggestion of a new header tag with information about the dimensions of images in the page — the header could (by the order of image data, or a tag or something that describes the image purpose: bug, background, header) give hints on which images to download first for an even smoother user experience.
And you would not need an extra HEAD request to get it, because a normal request retrieves the html header first, and the information would then be available for rendering
Nice!
There is Carrick Image Tagger, but it is very old software.
If anybody finds a good piece of recent software, post it for all, please.
These are the last 15 comments. Read all 32 comments here.
Adam Kalsey
Mobile: 916.600.2497
Email: adam AT kalsey.com
AIM or Skype: akalsey
©1999-2009 Adam Kalsey.
Content management by Movable Type.
Jo Cit
December 16, 2004 8:06 PM
The HEIGHT and WIDTH attributes are (a) optional, and (b) VERY useful.
If you don’t like them, don’t use them. You miss out on a feature that improves usability for your readers. In fact, you are sacrificing their usability for yours. How very kind of you. But hey, it’s your choice. The HTML standard never demands that you give that information.
But these pieces of information are very useful. Suppose you have a page with a table in it, and in the first column of that table is an image. The width of the table, and the positions of all elements in the other columns (in ALL rows, not just the one with the image), is determined by the width of the image - which means the browser has to get (at least some of) the image before laying out that table. (By the way, you can use these to cause an image to be stretched, too. It’s not only to duplicate what’s in the image file already.)
Perhaps what we need is a feature at the authoring stage: Zip through every HTML file, find every IMG tag, if it doesn’t have dimensions add them, if it has different dimensions mention it (maybe the image has changed). This means that the information is there for the browser, but you as the author don’t have to worry about it.
Tell you what: If you’re interested, I will WRITE you a program to do the job. The effort involved will be well spent, justifying a perfectly good feature. :)