Ingest: read camera star rating (EXIF/XMP) into photo.rating / pick #146

Open
opened 2026-11-03 12:23:52 +00:00 by spark · 3 comments
Owner

Photographers mark stars on the body (e.g. EOS R1). PhotoReport does not read them today; photos.rating stays 0 until set in the app.

Plan

  • Parse Rating from EXIF/XMP at ingest (JPEG from FTP, desktop USB, uploads).
  • Store as photos.rating (0–5).
  • Map a useful threshold to pick flag if that matches existing cull semantics (document the rule).
  • Tests with a fixture JPEG that has a Rating tag.

Out of scope: reading stars from the PTP catalog before download (Image Capture metadata); multi-event USB routing.

Photographers mark stars on the body (e.g. EOS R1). PhotoReport does not read them today; `photos.rating` stays 0 until set in the app. ## Plan - Parse Rating from EXIF/XMP at ingest (JPEG from FTP, desktop USB, uploads). - Store as `photos.rating` (0–5). - Map a useful threshold to pick flag if that matches existing cull semantics (document the rule). - Tests with a fixture JPEG that has a Rating tag. Out of scope: reading stars from the PTP catalog before download (Image Capture metadata); multi-event USB routing.
Author
Owner

Done on task/BIT-146-camera-rating-ingest

Behaviour

  • At ingest, readCameraInfo reads EXIF Rating / XMP xmp:Rating / RatingPercent.
  • Any star (1–5) sets photos.rating and flag = PICK (Escolhida), so star filters, escolhidas, autopilot priority and live PICKS all see them.
  • When a desktop preview is later replaced by the full original, stars are applied if the photo was still unrated (previews often lack the tag).

Tests

pnpm exec vitest run --config vitest.unit.config.ts src/ingest/exif.test.ts — 3 ok.

Needs an API deploy (not a desktop rebuild). Photos already in the library are unchanged; only new arrivals pick up camera stars.

## Done on `task/BIT-146-camera-rating-ingest` ### Behaviour - At ingest, `readCameraInfo` reads EXIF `Rating` / XMP `xmp:Rating` / `RatingPercent`. - Any star (1–5) sets `photos.rating` and `flag = PICK` (Escolhida), so star filters, escolhidas, autopilot priority and live PICKS all see them. - When a desktop preview is later replaced by the full original, stars are applied if the photo was still unrated (previews often lack the tag). ### Tests `pnpm exec vitest run --config vitest.unit.config.ts src/ingest/exif.test.ts` — 3 ok. Needs an **API deploy** (not a desktop rebuild). Photos already in the library are unchanged; only new arrivals pick up camera stars.
Author
Owner

Follow-up: backfill for photos already in the library

Earlier change only applied to new ingest. Now the worker also:

  • On start and every 60s, scans up to 25 READY originals with rating = 0 that were not yet checked.
  • Re-reads Rating from the file in PhotoReport storage (not the photographer’s work folder on the Mac).
  • Applies stars + Escolhida when found; always marks exif.cameraRatingChecked so files without stars are not re-read forever.
  • Does not overwrite a photographer REJECT, nor a rating already set in the app.

Deploy API + worker. After deploy, today’s imports catch up gradually (newest first).

## Follow-up: backfill for photos already in the library Earlier change only applied to **new** ingest. Now the worker also: - On start and every 60s, scans up to 25 READY originals with `rating = 0` that were not yet checked. - Re-reads Rating from the file in **PhotoReport storage** (not the photographer’s work folder on the Mac). - Applies stars + Escolhida when found; always marks `exif.cameraRatingChecked` so files without stars are not re-read forever. - Does not overwrite a photographer REJECT, nor a rating already set in the app. Deploy **API + worker**. After deploy, today’s imports catch up gradually (newest first).
Author
Owner

Merged as #147. API health reports f7570f87 — deploy landed. Worker backfill of on-camera ratings runs on start and every 60s.

Merged as #147. API health reports `f7570f87` — deploy landed. Worker backfill of on-camera ratings runs on start and every 60s.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: BitReport.pt/photoreport#146