MetadataHandling Enum

Controls what an encoder does with image metadata it cannot represent.

public enum MetadataHandling

Remarks

Animation settings and frame durations are structural data, not metadata: they are never affected by this policy. A cursor hotspot (FrameMetadata.Hotspot) is metadata for every output but cursors and animated cursors, which always store one. Note that dropping ImageMetadata.Orientation or ImageMetadata.IccProfile changes how viewers display the pixels; consider AutoOrient before stripping metadata. Payloads the format can store are validated when written: a malformed EXIF, ICC or XMP payload throws an InvalidImageContentException with MetadataHandling.Strict and MetadataHandling.DiscardUnsupported.

Fields

NameValueDescription
Strict0Writes all supported metadata and throws an UnsupportedImageFeatureException if any metadata cannot be represented. This is the default.
DiscardUnsupported1Writes all supported metadata and silently discards metadata the format cannot represent.
Strip2Writes no optional metadata (profiles, EXIF, XMP, text, resolution, orientation, a cursor hotspot the format has no field for).