Alex Rivera | Logout

How do browsers detect GIF image sizes?

Asked 2011-07-25T20:29:31.707
14

I was noticing that a GIF was being displayed with padding in FireFox 5 and IE 8. When I viewed the image size via FireBug, I noticed that it was a few pixels larger than expected.

Expected height: 160px vs. actual height: 171px

When I opened the GIF in an image editor, the editor displayed the correct dimensions, however when I ran ImageMagick identify I received the following information:

newGif.gif GIF 200x160 200x171+0+5 PseudoClass 256c 30kb 

If I modified the geometry to 200x160+0+0 the image displayed as I expected it to in FireFox. FireFox and IE 8 seemed to be referencing the Image's page geometry rather than dimensions! Is my analysis correct and if so is this true for all image types or just GIF's?

Updated, I have included an image for your viewing pleasure! This image displays as 200 x 171 for me in FF, but is actually 200 x 160 when you download and view in a graphics program.

here is the image

Edit
Report

1 Answer

0

I suspect that the GIF is an animated format, so it could contain several images located on different positions of the geometry frame. Therefore, the browser should reserve place for a whole thing.

answered 2011-07-27T09:47:29.257

Your Answer