background image
JPEG File Interchange Format, Version 1.02
7
JFIF Extension: Thumbnail stored using one byte per pixel
This extension supports thumbnails stored using one byte per pixel and a color palette in
the extension_data field. The syntax of extension_data is:
Xthumbnail (1 byte)
Thumbnail horizontal pixel count
Ythumbnail (1 byte)
Thumbnail vertical pixel count
palette (768 bytes) 24-bit RGB pixel values for the color palette.
The RGB values define the colors represented by
each value of an 8-bit binary encoding (0 - 255).
(pixel)n (n bytes) 8-bit values for the thumbnail pixels
n = Xthumbnail * Ythumbnail
JFIF Extension: Thumbnail stored using three bytes per pixel
This extension supports thumbnails stored using three bytes per pixel in the extension_data
field. The syntax of extension_data is:
Xthumbnail (1 byte)
Thumbnail horizontal pixel count
Ythumbnail (1 byte)
Thumbnail vertical pixel count
(RGB)n (3n bytes) Packed (24-bit) RGB values for the thumbnail
pixels, n = Xthumbnail * Ythumbnail
Useful tips
· you can identify a JFIF file by looking for the following sequence: X'FF', SOI, X'FF',
APP0, <2 bytes to be skipped>, "JFIF", X'00'.
· if you use APP0 elsewhere, be sure not to have the strings "JFIF" or "JFXX" right after
the APP0 marker.
· if you do not want to include a thumbnail, just program Xthumbnail = Ythumbnail = 0.
· be sure to check the version number in the special APP0 field. In general, if the major
version number of the JFIF file matches that supported by the decoder, the file will be
decodable.
· if you only want to specify a pixel aspect ratio, put 0 for the units field in the special
APP0 field. Xdensity and Ydensity can then be programmed for the desired aspect ratio.
Xdensity = 1, Ydensity = 1 will program a 1:1 aspect ratio. Xdensity and Ydensity should
always be non-zero.
[1] [2] [3] [4] [5] [6] [7] [8] [9]