Skip to main content

Module camera_names

Module camera_names 

Source
Expand description

Friendly camera-name resolution.

EXIF Make/Model tags often hold internal codenames (M2007J20CI, ILCE-7M3, iPhone15,2) — useless to a human reading the photo info panel. This module turns them into the marketing names users actually recognise.

Strategy, in priority order:

  1. Pattern-based transforms for prefixes we can decode without a lookup (Sony ILCE → α-series, Canon EOS → keep, Apple iPhone DeviceCode → marketing name from a small static map).
  2. Curated codename table for the long tail of Android codenames (Xiaomi, OnePlus, Realme, etc.) where the EXIF Model is an unreadable internal ID.
  3. Optional CSV lookup at data/device_codenames.csv, loaded lazily once. Lets users (or setup_assets.sh) drop in a richer list — same shape as Google Play’s public supported-devices CSV (retail_branding,marketing_name,device,model) — without us bundling a 700 KB file.
  4. Smart fallback: combine make + model, dedup if model already starts with the make, title-case where it looks like a codename, leave alone where it doesn’t.

Everything is pure-Rust, offline, and never makes a network call.

Functions§

friendly_camera_name
Resolve make + model (raw EXIF) into a friendly display name. Returns None only when both are empty.