Whether a photo carries an HDR gain map: the second picture that tells an HDR-capable screen how far to push the highlights past normal white. An iPhone photo is a normal (SDR) image plus this map; an ordinary renditions pipeline (ImageMagick) keeps the first and drops the second, which is why a rendition looks flat next to the same photo in Photos.
read/1 looks at the file's head only and returns %{} for a photo without
one, else
%{"gain_map" => true,
"container" => "jpeg", # "jpeg", "heic" or "avif"
"kinds" => ["apple", "iso21496"], # which descriptions of it the file has
"headroom" => 4.974161, # HDR peak as a multiple of SDR white, or nil
"gain_map_bytes" => 205482} # the size of the map's picture, or nilThe kinds:
"iso21496"— the ISO 21496-1 marker (iPhone 15 and later, Android 15)"apple"— Apple's own auxiliaryhdrgainmappicture and its headroom"ultrahdr"— Google's Ultra HDR / Adobe gain map metadata (hdrgm:), what Android phones write; newer ones write the ISO marker as well
A JPEG keeps the map as a second picture listed in its Multi-Picture directory;
a HEIC or AVIF as a tmap item (ISO) or Apple's auxiliary picture. Nothing is
decoded.