ImageGear v26.5 - Updated
Developer Guide / File Formats and Compressions / File Formats / Metadata Structures / JPEG Metadata Structure
In This Topic
    JPEG Metadata Structure
    In This Topic

    JPEG metadata structure is framed in several levels:

    • JPEG Level - contains all JPEG metadata
    • JPEG Marker Segment Levels - contains metadata of each particular JPEG marker segment

    JPEG Level

    Name Id Type Value Type Value Value Length Ignored on save
    "JPEG-JFIF" ImGearFormats.JPG Tree
    JPEG marker segment levels

    JPEG Marker Segment Levels

    The following JPEG marker segments metadata are supported:

    • Frame marker segment level - SOF0, SOF1, SOF2 and SOF3 (read only)
    • Frame component level
    • Scan marker segment level - SOS (read only)
    • Scan component level
    • Define-quantization-table marker segment level - DQT (read only)
    • Define-quantization-table level
    • Define-Huffman-tables marker segment level - DHT (read only)
    • Define-Huffman-table level
    • Comment marker segment level - COM (read/write)
    • Application marker segment level - APP0-APP15 (read/write)

    Segment level markers are described in the tables.

    Frame Marker Segment Level

    Name Id Type Value Type Value Value Length Ignored on save
    "Precision" ImGearJPEGTagIDs. FRAME_PRECISION Leaf UINT8 1 TRUE
    "Lines" ImGearJPEGTagIDs. FRAME_LINES Leaf UINT16 1 TRUE
    "SamplesPerLine" ImGearJPEGTagIDs. FRAME_SAMPLES_PER_LINE Leaf UINT16 1 TRUE
    "NumberOfComponents" ImGearJPEGTagIDs. FRAME_NUMBER_OF_COMPONENTS Leaf UINT8 <n> 1 TRUE
    Frame component level 1 ImGearJPEGTagIDs. FRAME_COMPONENT_SPEC Tree
    ...
    Frame component level <n> ImGearJPEGTagIDs. FRAME_COMPONENT_SPEC Tree

    Frame Component Level

    Name Id Type Value Type Value Value Length Ignored on save
    "Identifier" ImGearJPEGTagIDs. FRAME_COMPONENT_ID Leaf UINT <Component No.> 1 TRUE
    HVSamplingFactors ImGearJPEGTagIDs. FRAME_COMPONENT_HV_SAMPLING Leaf UINT 1 TRUE
    "QuantizationNumber" ImGearJPEGTagIDs. FRAME_COMPONENT_QUANT_SELECTOR Leaf UINT 1 TRUE

    <Component No.> is frame component identifier of appropriate component.

    Scan Marker Segment Level

    Name Id Type Value Type Value Value Length Ignored on save
    "ComponentNumber" ImGearJPEGTagIDs. SCAN_COMPONENT_NUMBER Leaf UINT8 <n> 1 TRUE
    Scan component level 1 ImGearJPEGTagIDs.SCAN_COMPONENT Tree
    Scan component level <n> ImGearJPEGTagIDs.SCAN_COMPONENT Tree
    "SpectralStart" ImGearJPEGTagIDs.SCAN_SP_START Leaf UINT8 1 TRUE
    "SpectralEnd" ImGearJPEGTagIDs.SCAN_SP_END Leaf UINT8 TRUE
    "AH_AL" ImGearJPEGTagIDs.SCAN_AH_AL Leaf UINT8 TRUE

    Scan Component Level

    Name Id Type Value Type Value Value Length Ignored on save
    "Selector" ImGearJPEGTagIDs. SCAN_SELECTOR Leaf UINT8 1 TRUE
    "DC_AC" ImGearJPEGTagIDs. SCAN_DC_AC Leaf UINT8 1 TRUE

    Define-Quantization-Table Marker Segment Level

    Name Id Type Value Type Value Value Length Ignored on save
    "QuantizationTable" ImGearJPEGTagIDs.QUANT_TABLE Tree
    "QuantizationTable ImGearJPEGTagIDs.QUANT_TABLE Tree

    Define-Quantization-Table Table Level

    Name Id Type Value Type Value Value Length Ignored on save
    "Descriptor" ImGearJPEGTagIDs. QUANT_TABLE_DESCRIPTOR Leaf UINT8 TRUE
    "Elements" ImGearJPEGTagIDs. QUANT_TABLE_ELEMENTS Leaf UINT8 or UINT16 TRUE

    Define-Huffman-Tables Marker Segment Level

    Name Id Type Value Type Value Value Length Ignored on save
    "HuffmanTable" ImGearJPEGTagIDs.HUFFMAN_TABLE Tree
    "HuffmanTable" ImGearJPEGTagIDs.HUFFMAN_TABLE Tree

    Define-Huffman-Table Table Level

    Name Id Type Value Type Value Value Length Ignored on save
    "Descriptor" ImGearJPEGTagIDs. HUFFMAN_TABLE_DESCRIPTORLeaf UINT8 TRUE
    "Lengths" ImGearJPEGTagIDs. HUFFMAN_TABLE_LENGTH Leaf UINT8 TRUE
    "Values" ImGearJPEGTagIDs. HUFFMAN_TABLE_VALUES Leaf UINT8 TRUE
    "Values" ImGearJPEGTagIDs. HUFFMAN_TABLE_VALUES Leaf UINT8 TRUE

    Comment Marker Segment Level

    Name Id Type Value Type Value Value Length Ignored on save
    "Comment" ImGearJPEGTagIDs. COMMENT Leaf STRING <ValueSize> FALSE

    Application Marker Segment Level

    There are several application marker segments whose data structure is well known. These segments are parsed and their data are passed in special format.

    These marker segments are:

    • JFIF APP0 segment
    • JFIF extension (JFXX) APP0 segment (read only)
    • EXIF APP1 segment
    • Photoshop Image Resource APP13 marker segment - includes some IPTC data and another Photoshop Image Resource metadata structure
    • Other application marker segment levels

    JFIF APP0 Segment

    Name Id Type Value Type Value Value Length Ignored on save
    "JFIF_HEADER" ImGearJPEGTagIDs. JFIF_ID Leaf STRING JFIF 5 TRUE
    "Version" ImGearJPEGTagIDs. JFIF_VERSION Leaf UINT16 1 FALSE
    "ResolutionUnits" ImGearJPEGTagIDs. JFIF_UNITS Leaf UINT8 1 FALSE
    "ResolutionX" ImGearJPEGTagIDs. JFIF_X_RES Leaf UINT16 1 FALSE
    "ResolutionY" ImGearJPEGTagIDs. JFIF_Y_RES Leaf UINT16 1 FALSE
    "ThumbnailWidth"18 ImGearJPEGTagIDs. JFIF_THUMB_WIDTH Leaf UINT8 1 TRUE
    "ThumbnailHeight"19 ImGearJPEGTagIDs. JFIF_THUMB_HEIGHT Leaf UINT8 1 TRUE

    Photoshop Image Resource APP13 Marker Segment

    Name Id Type Value Type Value Value Length Ignored on save
    "PHOTOSHOP_HEADER" ImGearJPEGTagIDs. PHOTOSHOP_HEADER Leaf STRING "Photoshop 3.0" 14 FALSE
    Photoshop Image Resource level 1
    ...
    Photoshop Image Resource level n

    Other Application Marker Segment Levels

    Name Id Type Value Type Value Value Length Ignored on save
    "DATA" ImGearJPEGTagIDs. BINARY_DATA Leaf RAW_DATA <ValueSize> FALSE