HEIC (High-Efficiency Image Container) is a container that can contain High-Efficiency Image Format HEIF images. XMP is an XML-based metadata standard, that can store metadata properties as name/value pairs. However, EXIF (Exchangeable Image File Format) is the standard and defines how to store metadata properties in the most common images and audio formats.  In this article, we will learn how to extract, update, and remove the XMP and EXIP metadata of the HEIF/HEIC images using C# within .NET applications.

The following topics are covered below:

.NET API for XMP and EXIF Metadata

GroupDocs.Metadata provides .NET API to automate metadata management within .NET applications. The API allows to read, update, add, clean/remove, and traverse the metadata for many file formats. Various metadata standards like EXIF, IPTC, and XMP are supported by the API. You can also visit the documentation for the complete list of supported file formats for metadata manipulation.

You can download the DLLs or MSI installer from the downloads section or install the API in your .NET application via NuGet.

PM> Install-Package GroupDocs.Metadata

Read EXIF data of HEIC / HEIF Images in C#

The following are the steps to read and extract EXIF data of HEIC and HEIF images.

  • Load the HEIF or HEIC image using the Metadata class.
  • Get the root package.
  • Retrieve the EXIF package from the root package.
  • Traverse the EXIF data properties.
  • Furthermore, you can get the IFD (Image File Directory) and GPS information from the EXIF package.

The following code shows how to get EXIF data, IFD and GPS metadata information of the HEIC image using C#.

Read XMP data of HEIC / HEIF Images in C#

The following steps reads XMP metadata of HEIC or HEIF images.

  • Load the HEIF or HEIC image using the Metadata class.
  • Get the root package using the getRootPackage method.
  • From the root package, you can get the XMP basic information.
  • Further, you can get the DCMI Dublin Core information.
  • Additionally, you can get Photoshop information using the getPhotoshop method.

The following source code shows how to get XMP basic, DCMI, and Photoshop information in C#.

Likewise, there are many setter methods to set or update different XMP properties. You can even provide your own key-value pair to set the custom XMP package property.

Remove EXIF and XMP Metadata of HEIC/HEIF Images in C#

You can just set the respective EXIF package or XMP package to null to remove all the metadata properties.

The following code removes the EXIF data of HEIC images in C#.

The following code removes the XMP data of HEIC images in C#.

Get a Free API License

You can get a free temporary license in order to use the API without the evaluation limitations.

Conclusion

To sum up, we have learned to extract, update, remove EXIF and XMP metadata from the HEIF/HEIC images in C#. Furthermore, you have seen how to get IFD and GPS information from these images. Now you can easily get this information and also start building your own applications like GroupDocs.Metadata App Product Family to automate metadata information.

For more information, options, and examples, you can visit the documentation and the GitHub repository. For further queries, contact us on the support forum.

See Also