---
title: "Read XMP Property"
canonical: https://www.graphicsmill.com/samples/Metadata/XMP/ReadXmpProperty_cs
product: "Graphics Mill"
source: "Metadata/XMP/ReadXmpProperty.cs"
---

# Read XMP Property

Reads specific XMP property.

## Instruction

Extract and display the creation date from XMP metadata in a JPEG image.

## Usings

```csharp
using System;
using Aurigma.GraphicsMill.Codecs;
```

## Code Snippet

```csharp
using (var reader = new JpegReader("Apple.jpg"))
{
    // Check if XMP data are present in the file
    if (reader.Xmp != null)
    {
        // Get an XML code from the reader
        var xmp = new XmpData(reader.Xmp);

        // Print the value of the xmp:XmpCreateDate tag if it exists
        if (xmp.Contains(XmpTagNames.XmpCreateDate))
        {
            Console.WriteLine(
                "\n\nCreate date {0}",
                xmp[XmpTagNames.XmpCreateDate]);
        }
    }
}
```

## Explanation

The code:

- Reads the XMP metadata from the input JPEG image.
- If the XMP data contains the `xmp:XmpCreateDate` tag, it prints the value associated with this tag, which indicates the creation date.

## Tags

- [Read](<https://www.graphicsmill.com/samples/tags/read_md>): Reading images with codecs
- [XMP](<https://www.graphicsmill.com/samples/tags/xmp_md>): Managing XMP metadata

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/Metadata/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [ReadXmpProperty.txt](<https://www.graphicsmill.com/samples/Metadata/compiled/Debug/ReadXmpProperty_txt>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Codecs.ImageReader.Xmp](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_ImageReader_Xmp.htm.md>)
- [Aurigma.GraphicsMill.Codecs.JpegReader](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_JpegReader.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpData](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_XmpData.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpData.Contains(Object)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_XmpData_Contains_1_d02429b3.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpTagNames](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_XmpTagNames.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpTagNames.XmpCreateDate](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_XmpTagNames_XmpCreateDate.htm.md>)
