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.
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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, asbackup-metadata --exifdoes.Definition of done
imageMetadata, exactly whatextractImageMetadatainsrc/metadata-backup.tsreturns 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, asphoto.exif()reads none: reading a whole video into memory to look for tags is not worth it.imageMetadataError. It fails neither the file nor the run, as inbackup-metadata.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, possiblysrc/metadata-backup.ts, tests,README.md,TODO.md.Model: opus-5-5