0 out of 4 rated this helpful - Rate this topic

Native Image Format Metadata Queries

This topic provides an overview of the metadata query language queries for reading and writing metadata supported by GIF, PNG, TIFF and Jpeg images.

This topic contains the following sections.

Prerequisites

To understand this topic, you should be familiar with the Windows Imaging Component (WIC) metadata system as described in the WIC Metadata Overview. You should also be familiar with the query language used to read and write metadata, as described in Metadata Query Language Overview.

Introduction

The following sections contain tables that list the available metadata queries for each image file type. Each table has the following columns:

  • Path - The query path used to retrieve the metadata item.
  • Name - The name of the metadata item.
  • Type - The type of the metadata item retrieved from the query path.

The query paths are used by the WIC metadata API to access the embedded metadata of an image. The following example code demonstrates using an IWICMetadataQueryReader to query for a JPEG's IFD metadata block.


// Not shown: image decoding 
IWICMetadataQueryReader *pQueryReader = NULL;
IWICMetadataQueryReader *pIFDReader = NULL;

// Get the query reader.
if (SUCCEEDED(hr))
{
    hr = pFrameDecode->GetMetadataQueryReader(&pQueryReader);
}

if (SUCCEEDED(hr))
{
    // Get the nested IFD reader.
    hr = pQueryReader->GetMetadataByName(L"/app1/ifd", &value);
    if (value.vt == VT_UNKNOWN)
    {
        hr = value.punkVal->QueryInterface(IID_IWICMetadataQueryReader, (void **)&pIFDReader);
    }
    PropVariantClear(&value); // Clear value for new query.
}

GIF Metadata

The Graphics Interchange Format (GIF) image format supports both global and frame level metadata. The following two sections provide the metadata query paths available for GIF's global and frame level metadata.

Global Metadata

The following table provides the available metadata query paths that can be used to access global GIF metadata.

PathNameType
/commentext or /[*]commentext where * = 0 to NComment ExtensionVT_UNKNOWN - A query reader/writer
/commentext/TextEntryVT_LPSTR
/logscrdescLogical Screen DescriptionVT_UNKNOWN - A query reader/writer
/logscrdesc/SignatureVT_UI1 | VT_VECTOR
/logscrdesc/HeightVT_UI2
/logscrdesc/GlobalColorTableFlagVT_UI2
/logscrdesc/ColorResolutionVT_BOOL
/logscrdesc/SortFlagVT_UI1
/logscrdesc/GlobalColorTableSizeBOOL
/logscrdesc/BackgroundColorIndexVT_UI1
/logscrdesc/PixelAspectRatioVT_UI1
/appext or /[*]appext where * = 0 to NApplication ExtensionVT_UNKNOWN - A query reader/writer
/appext/ApplicationVT_UI1 | VT_VECTOR
/appext/DataVT_UI1 | VT_VECTOR

 

Frame Metadata

The following table provides the available metadata query paths that can be used to access frame level GIF metadata.

PathNameType
/grctlextGraphic Control ExtensionVT_UNKNOWN - query reader/writer
/grctlext/DisposalVT_UI1
/grctlext/UserInputFlagVT_BOOL
/grctlext/TransparencyFlagVT_BOOL
/grctlext/DelayVT_UI2
/grctlext/TransparentColorIndexVT_UI1
/imgdescImage DescriptorVT_UNKNOWN - query reader/writer
/imgdesc/LeftVT_UI2
/imgdesc/TopVT_UI2
/imgdesc/WidthVT_UI2
/imgdesc/HeightVT_UI2
/imgdesc/LocalColorTableFlagVT_BOOL
/imgdesc/InterlaceFlagVT_BOOL
/imgdesc/SortFlagVT_BOOL
/imgdesc/LocalColorTableSizeVT_UI1

 

PNG Metadata

The Portable Network Graphics (PNG) image format supports frame level metadata.

Frame Metadata

The following table provides the available metadata query paths that can be used to access frame level PNG metadata.

PathNameType
/tEXt or /[*]tEXt where * = 0 to NText ChunkVT_UNKNOWN - tEXt query reader/writer
/tEXt/{str=*} where * = identifying keyword for textVT_LPSTR
/gAMAGama ChunkVT_UNKNOWN - gAMA query reader/writer
/gAMA/ImageGammaVT_UI4
/iTXt or /[*]iTXt where * = 0 to NIText ChunkVT_UNKNOWN - iTXt query reader/writer
/iTXt/KeywordVT_LPSTR
/iTXt/CompressionFlagVT_UI1
/iTXt/LanguageTagLPSTR
/iTXt/TranslatedKeywordLPWSTR
/iTXt/TextEntryLPWSTR
/cHRMHRM ChunkVT_UNKNOWN - cHRM query reader/writer
/cHRM/WhitePointXVT_UI4
/cHRM/WhitePointYVT_UI4
/cHRM/RedXVT_UI4
/cHRM/RedYVT_UI4
/cHRM/GreenXVT_UI4
/cHRM/GreenYVT_UI4
/cHRM/BlueXVT_UI4
/cHRM/BlueYVT_UI4
/sRGBsRGB ChuckVT_UNKNOWN - sRGB query reader/writer
/sRGB/RenderingIntentVT_UI1
/tIMETime ChunkVT_UNKNOWN - tIME query reader/writer
/tIME/YearVT_UI2
/tIME/MonthVT_UI1
/tIME/DayVT_UI1
/tIME/HourVT_UI1
/tIME/MinuteVT_UI1
/tIME/SecondVT_UI1
/bKGDBackground ChunkVT_UNKNOWN - bKGB query reader/writer
/bKGD/BackgroundColorVT_UI1, VT_UI2 or VT_UI2 | VT_VECTOR
/hISThIST ChunkVT_UNKNOWN - hIST query reader/writer
/hIST/FrequenciesVT_VECTOR | VT_UI2
/iCCPiCCP ChunkVT_UNKNOWN - iCCP query reader/writer
/iCCP/ProfileNameVT_LPSTR
/iCCP/ProfileDataVT_VECTOR | VT_UI1

 

For details about PNG

TIFF Metadata

The Tagged Image File Format (TIFF) image format supports frame level metadata.

Frame Metadata

The following table provides the available metadata query paths that can be used to access frame level TIFF metadata.

PathNameType
/ifd0 IFDVT_UNKNOWN - A query reader/writer
/ifd/{ushort=*} where * = 0 to 65535IFD Entry by IDVariable
/ifd/thumb or /ifd/{ushort=330}Thumbnail IFDVT_UNKNOWN - A query reader/writer
/ifd/xmp or /ifd/{ushort=700}XMPVT_UNKNOWN - A query reader/writer
/ifd/exif or /ifd/{ushort=34665}EXIFVT_UNKNOWN - A query reader/writer
/ifd/gps or /ifd/{ushort=34853}GPSVT_UNKNOWN - A query reader/writer
/ifd/exif/interop or /ifd/exif/{ushort=40965}InteropVT_UNKNOWN - A query reader/writer
/ifd/iptc or /ifd/{ushort=33723}IPTCVT_UNKNOWN - A query reader/writer
/ifd/iptc/{str=*} where * = IPTC keywordIPTC EntryVariable
/ifd/irb/8bimiptc/iptcIPTCVT_UNKNOWN - A query reader/writer
/ifd/irb/8bimiptc/iptc/{str=*}IPTC EntryVariable

 

Jpeg Metadata

The JPEG image format supports frame level metadata.

Frame Metadata

The following table provides the available metadata query paths that can be used to access frame level JPEG metadata.

PathNameType
/app0App0VT_UNKNOWN - App0 Query Reader/Writer
/app0/{ushort=0}VersionVT_UI2
/app0/{ushort=1}UnitsVT_UI1
/app0/{ushort=2}DpiXVT_UI2
/app0/{ushort=3}DpiYVT_UI2
/app0/{ushort=4}XthumbnailVT_UI1
/app0/{ushort=5}YthumbnailVT_UI1
/app0/{ushort=6}ThumbnailDataVT_BLOB
/app1App1VT_UNKNOWN - App1 Query Reader/Writer
/app1/ifd/ or /app1/{ushort=0}0 IFDVT_UNKNOWN - IFD Query Reader/Writer
/app1/thumb/ or /app1/{ushort=1}Thumbnail IFDVT_UNKNOWN - SubIFD Query Reader/Writer
/app13App13VT_UNKNOWN - App13 Query Reader/Writer
/app13/irb or /app13/{ushort=0}IRBVT_UNKNOWN - IRB Query Reader/Writer
/app13/irb/{ulonglong=*} where * = IRB Identifier (see IRB spec)IRB EntryVT_UNKNOWN - Unknown Query Reader/Writer
/app13/irb/{ulonglong=*}/{}IRB Entry ContentsVT_BLOB
/app13/irb/8bimiptc or /app13/irb/{ulonglong=61857348781060} 8BIMIPTCVT_UNKNOWN - 8BIMIPTC Query Reader/Writer
/app13/irb/8bimiptc/iptcIPTCVT_UNKNOWN - IPTC Query Reader/Writer
/app13/irb/8bimiptc/iptc/{str=*}IPTC EntryVariable
/app13/irb/8bimResInfo or /app13/irb/{ulonglong=61857348781037}8BIM Resolution InfoVT_UNKNOWN - Query Reader/Writer
/app13/irb/8bimResInfo/PStringVT_LPSTR
/app13/irb/8bimResInfo/HResolutionVT_UI4
/app13/irb/8bimResInfo/VResolutionVT_UI4
/app13/irb/8bimResInfo/WidthUnitVT_UI2
/app13/irb/8bimResInfo/HeightUnitVT_UI2
/app13/irb/8bimResInfo/HResolutionUnitVT_UI2
/app13/irb/8bimResInfo/VResolutionUnitVT_UI2
/comJpeg Comment VT_UNKNOWN - Comment Query Reader/Writer
/com/TextEntryLPSTR
/luminanceLuminanceVT_UNKNOWN - Luminance Query Reader/Writer
/luminance/TableEntryVT_UI1 | VT_VECTOR
/chrominanceChrominanceVT_UNKNOWN - Chrominance Query Reader/Writer
/chrominance/TableEntryVT_UI1 | VT_VECTOR
/xmpXMPVT_UNKNOWN - XMP Query Reader/Writer

 

Related topics

Conceptual
Windows Imaging Component Overview
WIC Metadata Overview
Metadata Query Language Overview
Metadata Extensibility Overview
How-to: Re-encode a JPEG Image with Metadata

 

 

Send comments about this topic to Microsoft

Build date: 3/14/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ