Image_size figures out the dimensions of GIF, JPEG, XBM, or PNG files. It's a minimal program, for situations where you don't want to install an entire image manipulation package.
It can also be used as a library routine callable from other programs by compiling it with -Dnomain.
See also: pbmplus.
ACME Labs / Software / image_size