Skip to content

PhoenixKit 2.61.0: HDR renditions and camera metadata removed from resized photos

PhoenixKit 2.61.0 keeps HDR in resized phone photos, so they still glow on an HDR screen, and removes the camera’s metadata, including the GPS position, from renditions by default.

HDR renditions

A JPEG with an HDR gain map, as iPhones and Pixels take them, can now keep that map in its renditions. The picture and its map are resized together, and the colour profile and HDR parameters are carried over. The standard medium and large sizes keep HDR. If an HDR rendition cannot be made, the ordinary one is. config :phoenix_kit, hdr_renditions: false turns this off.

Remove the camera’s metadata

Each rendition size has a Remove the camera’s metadata option, on unless a size says otherwise. It drops EXIF with the device, time and GPS position, XMP, maker notes and comments, keeps the colour profile and applies the orientation to the pixels. A phone photo’s 150 px thumbnail drops from 113 KB to 8 KB. HDR renditions keep their gain map but not the rest. The original upload is not changed.

Other changes

Rendition options are now stored in one JSON column, so later options need no migration. Editing an image clears its HDR record, and reverting the edit brings it back. decimal moves to 3.2.0, which clears a hex.audit advisory on 3.1.1.

Upgrading

Run mix phoenix_kit.update for V217, which moves the three existing rendition option columns into the new one. Existing renditions are not remade: the new options apply to sizes made from now on, so regenerate renditions to strip metadata from older ones.

Full release notes: PhoenixKit 2.61.0

2.61.0 · 11 October 2026

Migration V217. Ships HDR renditions, a per-rendition “remove the camera’s metadata” option, HDR gain-map detection in Media details, and the post-merge fixes from Codex’s check of them. Existing renditions are not remade; regenerate them to apply the metadata fixes.

Added

  • HDR gain-map detection. A JPEG that carries an HDR gain map (an iPhone or Pixel photo) is recognised on upload and shown in Media details (Storage.Hdr, recorded in files.metadata["hdr"]).
  • HDR renditions. A rendition of such a photo can keep its gain map, so it still glows on an HDR screen. Storage.HdrResize splits the photo into the picture and its map, resizes both with ImageMagick, carries the colour profile, EXIF, ISO 21496-1 and gain-map parameters over, and rewrites only what depends on size: the Multi-Picture directory and the map’s byte length in the picture’s XMP. If it cannot be made, the ordinary rendition is. config :phoenix_kit, hdr_renditions: false turns it off. The standard medium and large keep HDR.
  • A “Remove the camera’s metadata” option per rendition (strip_metadata, on unless a size says otherwise): EXIF with the device, time and GPS position, XMP, maker notes and comments are dropped, the colour profile stays, and the orientation is applied to the pixels. A phone photo’s 150 px thumbnail drops from 113 KB to 8 KB. An HDR rendition keeps the gain map and one orientation-only EXIF segment. It applies to sizes made from now on.
  • Rendition options are one JSON column (phoenix_kit_storage_dimensions.options, V217, loaded as Storage.DimensionOptions: crop_mode, fit_by, shape, keep_hdr, strip_metadata), so a new option needs no migration. V217 copies the three former option columns (V210, V211, V214) into it and empties them; they stay, nullable, until a later migration drops them.

Fixed

  • Stripped HDR renditions no longer leak metadata: the XMP of both pictures is parsed (Storage.HdrXmp) and only gain-map properties are kept; the gain map’s own segments are filtered too, and an unreadable packet falls back to the ordinary rendition instead of being copied.
  • The gain map’s byte length in the XMP is corrected whatever the spelling (prefixes, attribute order, element or attribute form), and a rewritten packet over the JPEG segment limit is refused rather than truncated.
  • A second picture whose directory entry does not start at a JPEG marker is ignored by gain-map detection.
  • HDR state follows edits and restores: editing an image clears metadata["hdr"], the unedited backup keeps it, and reverting restores it; the edited file’s own HDR is re-read after processing.
  • Image probes ignore recoverable ImageMagick warnings (-quiet), so a malformed-XMP warning can no longer end up in the parsed dimensions, frame count or format.
  • The DataForSEO balance note formats under Decimal 3.2 (its quantize now checks the context precision); decimal moves to 3.2.0, which also clears the hex.audit advisory on 3.1.1.
  • EXIF and HDR are recorded only against the bytes they were read from: the recording transaction now also checks that source_uuid is still the file’s original, so an edit swapping it mid-run cannot be overwritten.

i18n

  • Translations in the eight locales for the new rendition options.

PhoenixKit 2.61.0. Install or update: {:phoenix_kit, "~> 2.61"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.