internal/meta/README.md
Last Updated: February 11, 2026
The internal/meta package extracts, normalizes, and reports metadata from images, videos, and sidecars (Exif, XMP, JSON). It produces a meta.Data struct that downstream components (indexer, UI, API) consume for dates, GPS, camera/lens info, keywords, and motion-photo flags. The package aims to be loss-tolerant (accepts imperfect files), deterministic (stable parsing order), and explicit about fallbacks.
meta.Data; adjust consumers/tests instead of truncating here.TakenAt, TakenAtLocal, TakenNs). Tests expect nanosecond precision where available.MediaFile.TakenAt() truncates meta.Data timestamps to seconds before caching.photos.taken_at, photos.taken_at_local, and files.photo_taken_at are DATETIME (no fractional seconds).MapKey uses takenAt.Unix()), so nanoseconds do not affect grouping or comparisons.DATETIME(6) (or similar) and the truncation in MediaFile.TakenAt() removed.HasThumbEmbedded / HasVideoEmbedded, Codec, Duration, and capture accurate timestamps (including ns) when present.SanitizeString, SanitizeUnicode, and related helpers strip binary markers, quotes, and invalid Unicode; filenames and keywords use lower-case, dash/underscore-safe regexes.ReplaceAll and raw strings to avoid double escaping.geo.ClampCoordinateBounds before assigning meta.Data.Lat and meta.Data.Lng.docs.go.internal/meta/testdata cover Exif, XMP, motion photos, and edge cases (missing headers, panoramas, time offsets).