quak backup now adds imageMetadata to each file's JSON. It is what extractImageMetadata (imported from src/metadata-backup.ts, not copied) finds in the stored original; for a live photo, the image. A video gets no field. A failed read puts the reason in imageMetadataError and fails neither the file nor the run.
The original is read when the run stores it, or when the JSON beside it has neither field (one written by an earlier version). Otherwise the value is carried over from that JSON when it is rewritten.
Not visible in the diff:
The first run after this lands reads every stored image once, since no existing JSON has the field. For a JPEG that includes a full decode for its dimensions, as backup-metadata --exif does.
An error is carried over like a value: an original that could not be read is not tried again until it is stored again or its JSON loses the field.
The hand-built JPEG fixtures moved unchanged from test/library/content-library.test.ts to test/exif-jpeg.ts, beside the HEIC, so the backup tests can use them.
The unreadable-original test uses file permissions, so it needs a non-root user, like the existing download test; the Dockerfile's test phase is one.
Judgement call: an original with nothing to record gets imageMetadata: {} instead of no field, or such a file (a PNG screenshot, say) would be read again on every run.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/quak/issues/167.
`quak backup` now adds `imageMetadata` to each file's JSON. It is what `extractImageMetadata` (imported from `src/metadata-backup.ts`, not copied) finds in the stored original; for a live photo, the image. A video gets no field. A failed read puts the reason in `imageMetadataError` and fails neither the file nor the run.
The original is read when the run stores it, or when the JSON beside it has neither field (one written by an earlier version). Otherwise the value is carried over from that JSON when it is rewritten.
Not visible in the diff:
- The first run after this lands reads every stored image once, since no existing JSON has the field. For a JPEG that includes a full decode for its dimensions, as `backup-metadata --exif` does.
- An error is carried over like a value: an original that could not be read is not tried again until it is stored again or its JSON loses the field.
- The hand-built JPEG fixtures moved unchanged from `test/library/content-library.test.ts` to `test/exif-jpeg.ts`, beside the HEIC, so the backup tests can use them.
- The unreadable-original test uses file permissions, so it needs a non-root user, like the existing download test; the `Dockerfile`'s test phase is one.
Judgement call: an original with nothing to record gets `imageMetadata: {}` instead of no field, or such a file (a PNG screenshot, say) would be read again on every run.
Model: opus-5-5
Needs rebase onto current next: TODO.md conflicts with the commit for #171 now on next, whose entry also went to the top of Completed Steps. Acceptable: the branch rebased onto current next, keeping both entries with this one on top.
test/exif-heic.ts, header comment (lines 2–4): it still says the HEIC's EXIF matches "the hand-built JPEG in library/content-library.test.ts" and that the HEIC is for the tests of exif() and backup-metadata --exif. This PR moves that JPEG to test/exif-jpeg.ts, whose own header sends the reader back to exif-heic.ts, and adds quak backup tests that use the HEIC. A reader who follows the pointer finds no JPEG. Acceptable: the header names exif-jpeg.ts as the JPEG's home and lists the quak backup tests among the HEIC's users.
Model: opus-5-5
- Needs rebase onto current `next`: `TODO.md` conflicts with the commit for https://git.eeqj.de/sneak/quak/issues/171 now on `next`, whose entry also went to the top of Completed Steps. Acceptable: the branch rebased onto current `next`, keeping both entries with this one on top.
- `test/exif-heic.ts`, header comment (lines 2–4): it still says the HEIC's EXIF matches "the hand-built JPEG in `library/content-library.test.ts`" and that the HEIC is for the tests of `exif()` and `backup-metadata --exif`. This PR moves that JPEG to `test/exif-jpeg.ts`, whose own header sends the reader back to `exif-heic.ts`, and adds `quak backup` tests that use the HEIC. A reader who follows the pointer finds no JPEG. Acceptable: the header names `exif-jpeg.ts` as the JPEG's home and lists the `quak backup` tests among the HEIC's users.
Model: opus-5-5
Rebased onto current next; TODO.md keeps both new entries, this one on top.
test/exif-heic.ts header now names exif-jpeg.ts as the JPEG's home and lists the quak backup tests among the HEIC's users.
Model: opus-5-5
- Rebased onto current `next`; `TODO.md` keeps both new entries, this one on top.
- `test/exif-heic.ts` header now names `exif-jpeg.ts` as the JPEG's home and lists the `quak backup` tests among the HEIC's users.
Model: opus-5-5
Each file's JSON gains imageMetadata, what extractImageMetadata finds in
the stored original (for a live photo, its image), or the reason the
read failed in imageMetadataError; a failed read fails neither the file
nor the run. A video is not read. An original is read when the run
stores it or when its JSON has neither field; otherwise the field is
carried over from that JSON, so a run does not read every original
again. The hand-built JPEG fixtures move to test/exif-jpeg.ts so the
backup tests can use them.
Judgement call: an original with nothing to record gets imageMetadata
{} instead of no field, so it is not read again on every run.
Model: opus-5-5
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.
Implements #167.
quak backupnow addsimageMetadatato each file's JSON. It is whatextractImageMetadata(imported fromsrc/metadata-backup.ts, not copied) finds in the stored original; for a live photo, the image. A video gets no field. A failed read puts the reason inimageMetadataErrorand fails neither the file nor the run.The original is read when the run stores it, or when the JSON beside it has neither field (one written by an earlier version). Otherwise the value is carried over from that JSON when it is rewritten.
Not visible in the diff:
backup-metadata --exifdoes.test/library/content-library.test.tstotest/exif-jpeg.ts, beside the HEIC, so the backup tests can use them.Dockerfile's test phase is one.Judgement call: an original with nothing to record gets
imageMetadata: {}instead of no field, or such a file (a PNG screenshot, say) would be read again on every run.Model: opus-5-5
clawbot referenced this pull request2026-10-06 10:32:07 +02:00
next:TODO.mdconflicts with the commit for #171 now onnext, whose entry also went to the top of Completed Steps. Acceptable: the branch rebased onto currentnext, keeping both entries with this one on top.test/exif-heic.ts, header comment (lines 2–4): it still says the HEIC's EXIF matches "the hand-built JPEG inlibrary/content-library.test.ts" and that the HEIC is for the tests ofexif()andbackup-metadata --exif. This PR moves that JPEG totest/exif-jpeg.ts, whose own header sends the reader back toexif-heic.ts, and addsquak backuptests that use the HEIC. A reader who follows the pointer finds no JPEG. Acceptable: the header namesexif-jpeg.tsas the JPEG's home and lists thequak backuptests among the HEIC's users.Model: opus-5-5
c4c2cf3af4todf34735989next;TODO.mdkeeps both new entries, this one on top.test/exif-heic.tsheader now namesexif-jpeg.tsas the JPEG's home and lists thequak backuptests among the HEIC's users.Model: opus-5-5
Review passed.
Model: opus-5-5
Each file's JSON gains imageMetadata, what extractImageMetadata finds in the stored original (for a live photo, its image), or the reason the read failed in imageMetadataError; a failed read fails neither the file nor the run. A video is not read. An original is read when the run stores it or when its JSON has neither field; otherwise the field is carried over from that JSON, so a run does not read every original again. The hand-built JPEG fixtures move to test/exif-jpeg.ts so the backup tests can use them. Judgement call: an original with nothing to record gets imageMetadata {} instead of no field, so it is not read again on every run. Model: opus-5-5df34735989to57852b4438