The JPEG File Format

Original Documentation

The JPEG image standard is a standard for lossy (but efficient) image
compression made by the ???? Group. The endianness of the JPEG files is unknown
to me, there seem to exist both types of JPEG files.

The JPEG files are block oriented, there is a header for each JPG block,
but I was not able to find a list of all blocks - so you'll have to stick
with what I gathered here ;)

Format of a JPEG block (all data is in Motorola byte order) :
OFFSET              Count TYPE   Description
0000h                   1 word   Block ID
								   0FFD8h - JPEG signature block(4 chars="JFIF")
								   0FFC0h - JPEG color information
								   0FFC1h - JPEG color information
0002h                   1 word   Block size in bytes, without ID word.

Format of JPEG color information (motorola byte order) :
OFFSET              Count TYPE   Description
0000h                   1 byte   1=Grayscale image
0001h                   1 word   Height
0003h                   1 word   Width

Another try for JPEG identification could be this one :
OFFSET              Count TYPE   Description
0000h                   1 dword  ID=FFD9FFE0h
								 Big endian JPEG file (Intel)
								 Little endian JPEG file (Motorola)


This information is from and is used with permission.

More Resources