Date: 02-16-2022
Return to Index
created by gbSnippets
'JFIF is the standard which defines JPG file formats, consisting of multiple segments:
' - JFIF Segment
' - JFIF Extension
'JPEG Application Segment APP0
'Field Size (bytes) Description
APP0 marker 2 Always equals 0xFFE0
Length 2 Length of segment excluding APP0 marker
Identifier 5 Always equals "JFIF" (with zero following) (0x4A46494600)
Version 2 First byte is major version (currently 0x01), Second byte is minor version (currently 0x02)
Density Units 1 Units For Pixel density fields
X density 2 Integer horizontal Pixel density
Y density 2 Integer vertical Pixel density
Thumbnail Width (tw) 1 Horizontal Size of embedded JFIF thumbnail in Pixels
Thumbnail height (th) 1 Vertical Size of embedded JFIF thumbnail in Pixels
Thumbnail Data 3 × tw × th Uncompressed 24 Bit Rgb raster thumbnail
* 0 - No Units, aspect ratio only specified
* 1 - Pixels per inch
* 2 - Pixels per centimetre
'JFIF extension (JFXX) segment format
'Optional second application segment allows a thumbnail image to be
'embedded using several different image formats (to save space).
'Field Size (bytes) Description
APP0 marker 2 Always equals 0xFFE0
Length 2 Length of segment excluding APP0 marker
Identifier 5 Always equals "JFXX" (with zero following) (0x4A46585800)
Thumbnail format 1 Specifies what Data format is used For the thumbnail:
Thumbnail Data Variable Variable
*Thumbnail formats:
* 0x10 - JPEG format
* 0x11 - 1 byte per Pixel palettised format
* 0x13 - 3 byte per Pixel Rgb format
'gbs_00417
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm