The width and height of a GIF image might seem irrelevant to the usual programmer, but when it is required many programmers might not realize how easy it is to decode.Unlike the height and width of a JPEG file, the height of the gif is extremely easy to decode from its header. There is a manual conversion from 2 bytes to a short in this code to make it compatible for any processor and platform - a problem I acutally run into with some code while doing programming for both 68K and x86 CPUs.
Source Code
Change Log
June 10, 2006
small fix for a bug which retrieved reversed heights
References
Gif File Format Specification - a very detailed specification of the gif file format, can be used for a full decoder