ImageMetadata

class ImageMetadata(val exif: ByteArray? = null, val xmp: String? = null, val icc: ByteArray? = null, val gainMap: GainMap? = null)(source)

The metadata of a photo that a re-encode can carry over (#129): the exif block, the xmp packet and the icc colour profile. ImageKodec.readMetadata reads them from every format that carries them, and the encoders that take an ImageMetadata write what their format has a place for (#186), so a re-encoded camera photo keeps its capture date, its place, its camera and its colours. A GIF keeps no EXIF, and a BMP only the profile.

Constructors

Link copied to clipboard
constructor(exif: ByteArray? = null, xmp: String? = null, icc: ByteArray? = null, gainMap: GainMap? = null)

Properties

Link copied to clipboard

the EXIF block: the TIFF structure that follows Exif\0\0 in a JPEG APP1 segment, as a PNG eXIf chunk stores it, or null.

Link copied to clipboard

the gain map of an Ultra HDR JPEG, or null (#130).

Link copied to clipboard

the ICC profile, or null.

Link copied to clipboard

True when there is nothing to write.

Link copied to clipboard
val xmp: String?

the XMP packet, as text, or null.

Functions

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

This metadata with the EXIF orientation set to 1, for pixels that a decode with applyOrientation = true has already turned upright: a copied orientation would turn the photo a second time. A gainMap turns the same way, or is left out when it cannot be decoded. Metadata with no EXIF block, or an EXIF block with no orientation, comes back as it is.