quak backup writes each original's EXIF, XMP and dimensions into its JSON file #167

Closed
opened 2026-10-06 01:17:22 +02:00 by clawbot · 0 comments
Collaborator

Part of #162 (one cron-safe command that mirrors the whole account). Dispatched after #163 and #166 land, which change the same file.

What

quak backup <dir> writes the EXIF, XMP and dimensions read from each stored original into the file's JSON beside it, as backup-metadata --exif does.

Definition of done

  • Each per-file JSON gains imageMetadata, exactly what extractImageMetadata in src/metadata-backup.ts returns for the stored original (format, width, height, exif, exifRaw/exifError, xmp). For a live photo it is read from the image. No video is read, as photo.exif() reads none: reading a whole video into memory to look for tags is not worth it.
  • A read that fails puts the reason in imageMetadataError. It fails neither the file nor the run, as in backup-metadata.
  • A run does not re-read every stored original. The field is read when the original was stored by this run, or when the existing JSON beside it has neither field; otherwise it is carried over from that JSON when the JSON is rebuilt.
  • README "Backup layout" describes the field and when it is read.
  • Tests with the repo's JPEG and HEIC fixtures and stand-ins, never the real service: field written for a new original; carried over without a re-read on the next run; read for an original stored by an earlier version (JSON without it); none for a video; error field on an unreadable file.
  • TODO.md: an entry at the top of Completed Steps.

Notes

Reuse extractImageMetadata; do not copy it. Moving it to a module both commands import is fine.

Touches src/backup.ts, possibly src/metadata-backup.ts, tests, README.md, TODO.md.

Model: opus-5-5

Part of https://git.eeqj.de/sneak/quak/issues/162 (one cron-safe command that mirrors the whole account). Dispatched after https://git.eeqj.de/sneak/quak/issues/163 and https://git.eeqj.de/sneak/quak/issues/166 land, which change the same file. ## What `quak backup <dir>` writes the EXIF, XMP and dimensions read from each stored original into the file's JSON beside it, as `backup-metadata --exif` does. ## Definition of done - Each per-file JSON gains `imageMetadata`, exactly what `extractImageMetadata` in `src/metadata-backup.ts` returns for the stored original (`format`, `width`, `height`, `exif`, `exifRaw`/`exifError`, `xmp`). For a live photo it is read from the image. No video is read, as `photo.exif()` reads none: reading a whole video into memory to look for tags is not worth it. - A read that fails puts the reason in `imageMetadataError`. It fails neither the file nor the run, as in `backup-metadata`. - A run does not re-read every stored original. The field is read when the original was stored by this run, or when the existing JSON beside it has neither field; otherwise it is carried over from that JSON when the JSON is rebuilt. - README "Backup layout" describes the field and when it is read. - Tests with the repo's JPEG and HEIC fixtures and stand-ins, never the real service: field written for a new original; carried over without a re-read on the next run; read for an original stored by an earlier version (JSON without it); none for a video; error field on an unreadable file. - `TODO.md`: an entry at the top of Completed Steps. ## Notes Reuse `extractImageMetadata`; do not copy it. Moving it to a module both commands import is fine. Touches `src/backup.ts`, possibly `src/metadata-backup.ts`, tests, `README.md`, `TODO.md`. Model: opus-5-5
clawbot self-assigned this 2026-10-06 01:17:22 +02:00
Sign in to join this conversation.