[200 OK]: A Port80 Software Blog

We're all 200 OK: Web, HTTP and IIS Insights
posts - 199, comments - 719, trackbacks - 95

Hidden 404s - The Mystery of the Bad Shim GIFs

Port80 folks are always quite interested in the dreaded 404 error, not because we are particularly error-prone nor because we really love to criticize mistakes.  Likely, it is just that we have some sort of fascination with that worker animated GIF continually finishing up his “under construction” Web site: 
 

 
BTW, if you want to relive the pre-millennium golden age of Web design, go find your own animated GIFs like the ones here at http://www.animatedgif.net/underconstruction/construction.shtml.
 
Anyway, back to the point of this post -- there actually are 404 errors that you won't necessarily see in regular Web pages!  They live in many pages that we would consider to be working, 200 OK-style.  You might be skeptical, but, believe us, they are there.  These hidden mistakes are tough to spot -- we only saw them because we use all sorts of interesting network monitoring tools, but the end-user likely won't see them.  The issue: in (X)HTML tabled oriented Web page design, lots of invisible GIFs, often called spacer GIFs or shim GIFs, are used to prop open tables and add buffer space to the layout.  The GIF images are usually just 1 pixel by 1 pixel transparent images which are stretched to the desired size, like so:
 

 
Now, let's say for whatever reason, the spacer GIF is not uploaded. You make a typo someplace, etc., break the reference, and then what?  Well, actually, probably… nothing, and your user may never know.  The reason being is that the browser will use a broken image GIF in its place and, depending on the size of these shims, it may not even show up on screen. 
 
For example, below you see an image showing three browsers' displays of a non-existent spacer GIF. The top image is a real graphic, the one below is a 404. The way each browser displays a broken image varies.  In IE, the icon appears 6 pixels from the left and top of the space reserved for the image, while in Firefox it's 3 pixels. Opera does not seem to have an equivalent feature:
 

 

On top of this, IE does not start to display the broken image icon until the missing GIF is set to be at least 15 pixels wide, while in Firefox the icon is withheld until the image width is set to a minimum of 24 px.:
 

 
The final grab shows the broken GIF images in context, and you'll see in one table versus the next that it isn't obvious there is a broken image,  depending on size and such:
 

 
Another mystery of this whole thing is that, when we tried a few Web quality assurance programs that include link checking, they didn't report the broken spacer GIFs. 
 
In closing, you might wonder why care about unseen 404s? Well, that's yet another mystery that remains unsolved (but we are on the case).

- Port80

 

posted on Thursday, June 23, 2005 3:25 PM

Feedback

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

An interesting post, but I fail to see exactly what the mystery is... by which I of course mean that it's not clear what it is that you think is mysterious! All I see is yet more differentiation in content parsing & error handling between browsers...
8/3/2005 8:19 AM | Marcus Tucker

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

The mystery is how to write more fun sounding blog posts, I guess.

:)

The main point we were trying to get across was that 404 errors that are happening behind the scenes without anybody noticing. As you correctly point out, the reason clearly has to do with the way the browser deals with broken images... no mystery there to those who understand it, but to others who have never heard of it, I guess it would seem mysterious that they have 404s they are not aware of.

Thanks for reading and commenting.

- Port80
8/3/2005 11:37 AM | Chuck @ Port80

# how do I get my spacer gif's to not upload as broken images

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

I have placed spacer's throughout my site layout and I had someone testing who brought to my attentiion that they are appearing as broken images...However when I viewed it I don't see anything wrong.....Is there a standard way to make sure spacer's are insured to not be broken???
1/18/2006 6:59 AM | Amanda

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

Not really, unless you have software to emulate how different browsers display the page -- or have a lab with all browsers you care to test for...

Cheers,
Chris @ Port80
1/18/2006 9:35 AM | Chris @ Port80

# re: Hidden 404s - The Mystery of the Bad Shim GIFs

thanks nice text.
4/7/2008 7:52 AM | software

Post Comment

Title:  
Name:  
Url:  
Comment:  
Verify:
(Enter the word as it appears in the box above.)