Is there a good way to see what format an image is, without having to read the entire file into memory?
Obviously this would vary from format to format (I\'m particular
Either file
on the *nix command-line or reading the initial bytes of the file. Most files come with a unique header in the first few bytes. For example, TIFF's header looks something like this:
0x00000000: 4949 2a00 0800 0000For more information on the TIFF file format specifically if you'd like to know what those bytes stand for, go here.