I'm trying to figure out a way to read the height and width data out of images programatically -- by opening the binary and finding the right bytes.
GIF is easy, there are four bytes, and they're always in the same place in the file, but I'm finding it very difficult to understand the JPG specification.
You can get the spec from Wotsit at this URL:
and all I really need is for someone to explain it to me -- is there a unique marker in hex that I can rely on to come before the height and width bytes, (or 3 bytes before or whatever) or is it more complicated than that? What's the formula for tracking down those four bytes?