Preserve metadata

The Image Editing API allows you to choose whether metadata embedded in the original image should be preserved in the output.

Use this setting if you want to retain XMP or EXIF metadata across processing workflows.

To enable this, set the parameter preserveMetadata to:

  • xmp: XMP metadataarrow-up-right will be preserved.

  • exifSubsetWithXmpCompatibility : Preserves the Copyright and UserComment EXIF tags in the output image.

    • For png output: These tags are written as both EXIF and XMP metadata. This dual-write ensures compatibility with tools that don't yet support the EXIF chunk in PNG, a location that was only standardized in the PNG spec in June 2025arrow-up-right and may not yet be supported by all image readers. If your downstream tooling reads XMP, your metadata will be found regardless of EXIF chunk support.

    • For jpeg and webp output: Only EXIF tags are preserved. XMP copying is not performed, as EXIF is natively and widely supported in these formats.

  • exifSubset (deprecated): Use exifSubsetWithXmpCompatibility instead. This older option preserves Copyright and UserComment as EXIF tags only, without the XMP compatibility layer needed for PNG outputs.

  • never (default): all metadata will be stripped from the output image.

circle-exclamation

Last updated

Was this helpful?