ImageMetadata
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.
Functions
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.