Working with metadata in AVIF images

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Metadata MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-metadata -- dnx GroupDocs.Metadata.Mcp --yes
Folders, licensing and more →

AVIF (AV1 Image File Format) stores images compressed with the AV1 codec in a HEIF container. Like other modern image formats, AVIF files can carry EXIF and XMP metadata. The AvifRootPackage class implements both the IExif and IXmp interfaces.

Reading EXIF and XMP properties

  1. Load an AVIF image
  2. Get the root metadata package
  3. Read the XMP package with getXmpPackage and the EXIF package with getExifPackage. Both can be null if the image has no such metadata.

advanced_usage.managing_metadata_for_specific_formats.image.avif.AvifReadProperties

try (Metadata metadata = new Metadata(Constants.InputAvif)) {
    AvifRootPackage root = metadata.getRootPackageGeneric();

    if (root.getXmpPackage() != null && root.getXmpPackage().getSchemes().getXmpDynamicMedia() != null) {
        System.out.println(String.format("XmpDynamicMedia Artist: %s", root.getXmpPackage().getSchemes().getXmpDynamicMedia().getArtist()));
    }

    if (root.getExifPackage() != null) {
        System.out.println(String.format("ExifPackage Artist: %s", root.getExifPackage().getArtist()));
    }
}

Working with XMP metadata

For more details on reading and updating XMP metadata, please refer to the following guide: Working with XMP metadata.

Working with EXIF metadata

Please find more code samples in the Working with EXIF metadata section.

More resources

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free online document metadata management App

Along with full featured Java library we provide simple, but powerful free Apps.

You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online Free Online Document Metadata Viewing and Editing App.