<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageIO",
  "identifier" : "/documentation/ImageIO/CGImageMetadataCreateFromXMPData(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@F@CGImageMetadataCreateFromXMPData"
  },
  "title" : "CGImageMetadataCreateFromXMPData(_:)"
}
-->

# CGImageMetadataCreateFromXMPData(_:)

Creates a collection of metadata tags from the specified XMP data.

```
func CGImageMetadataCreateFromXMPData(_ data: CFData) -> CGImageMetadata?
```

## Parameters

`data`

An object containin XMP data. The contents of this object must represent a complete XMP tree. The XMP data may include packet headers.

## Return Value

A [`CGImageMetadata`](/documentation/ImageIO/CGImageMetadata) object that contains the parsed metadata information, or `NULL` if an error occurs. You are responsible for releasing the returned object.

## Discussion

Use this function to parse the raw XMP data from an image and build a parseable set of metadata tags. Use the returned object to enumerate the tags or search for individual tags within the collection.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)