PhoenixKitWeb.Components.Core.FileExifPanel (phoenix_kit v2.62.2)

Copy Markdown View Source

A photo's EXIF, for the viewer's sidebar: the camera, exposure, dates and GPS position worth keeping (Storage.Exif.summary/1, in the file's metadata["exif"]), and a way to look at the whole dump.

  • A photo whose EXIF was never read (one uploaded before it was kept) shows a Read EXIF button; reading records the summary and the position.
  • A photo with EXIF shows its groups, All EXIF (every tag the original carries, grouped, read on request and not stored) and Read again.
  • A photo that was read and had none says so.

Nothing here writes: the buttons send read_exif, show_exif and hide_exif to the host (target), which decides who may. A host must not show this panel to anyone who may not see where a photo was taken.

Summary

Functions

The groups of a summary as [{title, [{label, value}]}]: what the panel prints.

Functions

file_exif_panel(assigns)

Attributes

  • id (:string) (required)
  • exif (:any) - the file's metadata["exif"]: nil when never read. Defaults to nil.
  • latitude (:any) - Defaults to nil.
  • longitude (:any) - Defaults to nil.
  • tags (:any) - every tag of the original (Storage.exif_tags/1) while the whole dump is open. Defaults to nil.
  • status (:atom) - Defaults to nil.Must be one of nil, :reading, or :error.
  • can_read (:boolean) - whether the buttons that record are offered. Defaults to false.
  • target (:any) - the phx-target of the buttons. Defaults to nil.

summary_groups(exif)

@spec summary_groups(map() | nil) :: [{String.t(), [{String.t(), String.t()}]}]

The groups of a summary as [{title, [{label, value}]}]: what the panel prints.