

Although these two handlers are usually implemented in pairs for a specific format, that is not a requirement. To fully support other metadata formats, two types of handlers must be developed - a metadata reader to read metadata and a metadata writer to write metadata. Therefore, WIC provides APIs for creating additional metadata handlers that can extend metadata support to other formats. However, there are some metadata formats that are not natively supported. Metadata ExtensibilityĪs mentioned previously, WIC provides several metadata handlers to read and write metadata for common metadata formats. You can obtain a metadata writer from the decoder or individual frames using querying for a block writer ( IWICMetadataBlockWriter) interface. In addition to using a query reader, you can also access a metadata writer directly to write metadata. To see which natively supported formats support fast metadata encoding, see the table in the Supported Metadata Formats section later in this document.īehind the scenes, a query writer uses a metadata writer ( IWICMetadataWriter) to write the metadata described by the query expression. Not all metadata formats support fast metadata. LPCWSTR pwzRatingQuery = L"/app1/ifd/", &value)

#Edit exif metadata in windows vista code
The following code demonstrates using the query reader to obtain the MicrosoftPhoto rating value. This is done by using the query reader's GetMetadataByName method. The following code uses a query expression to request a specific metadata item within the App1 nested image file directory (IFD) block. Hr = pFrameDecode->GetMetadataQueryReader(&pQueryReader) Ī query reader provides methods to obtain information about specific metadata, and a means to specify a metadata item to retrieve.
#Edit exif metadata in windows vista how to
The following code demonstrates how to access a query reader for an individual frame by using the query reader's GetMetadataQueryReader method.

The metadata query reader component is implemented by the codec and can be accessed at the decoder level or through individual image frames, which is the more common method. The primary way to read metadata is to use a metadata query reader ( IWICMetadataQueryReader) to access specific metadata items. The WIC APIs provide COM components that make it easy for applications to read and write image metadata. WIC is flexible enough to handle both frame-level metadata and metadata outside of an image's individual frame. Though not common today and not supported by the native image codecs, some image formats may also support metadata outside of an image frame. Formats that support multiple frames, such as TIFF, may have metadata attached to each image frame as this diagram shows. The JPEG format does not support multiple image frames, so the metadata is conceptually attached to this single frame. In this example image, the metadata is embedded in the image file within an image frame. The following diagram illustrates the contents of a JPEG file that includes embedded metadata blocks and metadata items. Using the WIC APIs and common metadata formats, applications can easily write or read this type of metadata to or from images. This allows for better discoverability of images and a convenient way to categorize images. For example, the Windows Photo Gallery in Windows Vista enables you to add descriptions and category tags to images. Accessing the metadata makes it easier to perform tasks such as asset management, file location, or determining copyright information. An image might contain metadata such as a description, rating, category tags, and copyright information. This information can be used in several ways. Metadata provides extended information about an image. It also helps to have a general familiarity with some of the imaging metadata formats in use today. To understand this topic, you should be familiar with the WIC encoder and decoder interfaces and their related Component Object Model (COM) components, as described in the Windows Imaging Component Overview. This topic contains the following sections. WIC provides interfaces that enable you to read and write this metadata for several common metadata formats including Extensible Metadata Platform (XMP), Exchangeable Image File (EXIF), and Png Textual Data (tEXt). Although it is contained within the image file itself, this metadata is not part of the rendering data. Image metadata is data embedded inside an image file that provides additional information about the image, such as the device used to capture the image or the dimensions of the image. It provides an introduction to reading and writing image metadata, the metadata query language, and metadata handler extensibility. This topic introduces the imaging metadata support provided by the Windows Imaging Component (WIC).
