---
title: "Read XMP Metadata"
canonical: https://www.graphicsmill.com/samples/Metadata/XMP/ReadXmpMetadata_cs
product: "Graphics Mill"
source: "Metadata/XMP/ReadXmpMetadata.cs"
---

# Read XMP Metadata

Reads all XMP properties.

## Instruction

Extract and display XMP metadata from a JPEG image.

## Usings

```csharp
using System;
using Aurigma.GraphicsMill.Codecs;
```

## Code Snippet

```csharp
using (var reader = new JpegReader("Chicago.jpg"))
{
    if (reader.Xmp != null)
    {
        var xmp = new XmpData(reader.Xmp);

        foreach (XmpNode node in xmp.Values)
        {
            if (node.NodeType == XmpNodeType.SimpleProperty)
            {
                Console.WriteLine("{0}: {1}", node.Name, node);
            }
        }
    }
}
```

## Explanation

The code:

- Reads the XMP metadata from the input JPEG image.
- Iterates through each node in the XMP data and prints the name and value for nodes of type SimpleProperty.

## 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

- [ReadXmpMetadata.txt](<https://www.graphicsmill.com/samples/Metadata/compiled/Debug/ReadXmpMetadata_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.Values](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_XmpData_Values.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpNode](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_XmpNode.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpNode.Name](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_XmpNode_Name.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpNode.NodeType](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_XmpNode_NodeType.htm.md>)
- [Aurigma.GraphicsMill.Codecs.XmpNodeType](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_XmpNodeType.htm.md>)
