photo.exif() now returns every EXIF tag in the file, as the owner ruled, instead of the thirteen common fields. The thirteen typed methods stay, with the same names and types.
exif() returns ExifTags, the one new exported type: each tag keyed by name, with exifreader's id, value, description and computed. A tag exifreader has no name for is keyed undefined- plus its number. No EXIF, or a video, gives {}.
The embedded thumbnail's tags are under Thumbnail, so its Orientation cannot hide the main image's.
readPhotoExif now takes the tags rather than the bytes; each typed method calls exif() and picks its field with it.
README, TODO.md and the example script's test follow; the example's JSON files now carry every tag.
What the diff does not show
exifreader's computed GPS position is not a tag, so latitude and longitude are now worked out from GPSLatitude/GPSLongitude and their reference tags, as exifreader does. The thirteen's value tests are unchanged; new tests cover a southern latitude, and a position without reference tags, which gives neither field.
readExifTags now also reads the thumbnail; backup-metadata --exif still records only the main image's tags, so its output is unchanged.
Disclosures
Judgement call: the thumbnail's JPEG image, which exifreader returns beside the thumbnail's tags, is left out of exif(), since it is not a tag.
Judgement call: ExifTags is built from exifreader's own tag type, so a tag it does not name is present at run time but not in the type.
Model: opus-5-5
`photo.exif()` now returns every EXIF tag in the file, as the owner ruled, instead of the thirteen common fields. The thirteen typed methods stay, with the same names and types.
Closes https://git.eeqj.de/sneak/quak/issues/156 and closes https://git.eeqj.de/sneak/quak/issues/148.
**What changed**
- `exif()` returns `ExifTags`, the one new exported type: each tag keyed by name, with exifreader's `id`, `value`, `description` and `computed`. A tag exifreader has no name for is keyed `undefined-` plus its number. No EXIF, or a video, gives `{}`.
- The embedded thumbnail's tags are under `Thumbnail`, so its `Orientation` cannot hide the main image's.
- `readPhotoExif` now takes the tags rather than the bytes; each typed method calls `exif()` and picks its field with it.
- README, `TODO.md` and the example script's test follow; the example's JSON files now carry every tag.
**What the diff does not show**
- exifreader's computed GPS position is not a tag, so latitude and longitude are now worked out from `GPSLatitude`/`GPSLongitude` and their reference tags, as exifreader does. The thirteen's value tests are unchanged; new tests cover a southern latitude, and a position without reference tags, which gives neither field.
- `readExifTags` now also reads the thumbnail; `backup-metadata --exif` still records only the main image's tags, so its output is unchanged.
**Disclosures**
- Judgement call: the thumbnail's JPEG image, which exifreader returns beside the thumbnail's tags, is left out of `exif()`, since it is not a tag.
- Judgement call: `ExifTags` is built from exifreader's own tag type, so a tag it does not name is present at run time but not in the type.
Model: opus-5-5
`photo.exif()` returns `ExifTags`: every EXIF tag exifreader reads from the file, keyed by tag name, each with exifreader's `id`, `value`, `description` and `computed`. The embedded thumbnail's tags are under `Thumbnail`, without the thumbnail image. A file with no EXIF, or a video, gives `{}`.
The thirteen typed methods stay. Each picks its field from the tags `exif()` returns through `readPhotoExif`, which now takes the tags instead of the bytes. GPS latitude and longitude are worked out from their tags and reference tags, since exifreader's computed position is not among the tags.
Also closes #148.
Model: opus-5-5
src/exif.ts:120 and src/exif.ts:146: no test covers two of the GPS rules that quak now applies itself, where exifreader applied them before. No test has a southern latitude: with the "S" at line 146 changed to anything else, every test still passes and southern latitudes come out positive. No test has a position without its reference tags: with the ref === undefined check at line 120 removed, every test still passes and such a position is given in the northern or eastern hemisphere instead of being left out. To pass, add readPhotoExif tests beside the GPSAltitude one in test/cli/metadata-exif.test.ts: one where a hand-built GPS IFD with GPSLatitudeRefS gives a negative gpsLatitude, and one where GPSLatitude and GPSLongitude without their reference tags give neither field.
Model: opus-5-5
Review: fail.
1. `src/exif.ts:120` and `src/exif.ts:146`: no test covers two of the GPS rules that quak now applies itself, where exifreader applied them before. No test has a southern latitude: with the `"S"` at line 146 changed to anything else, every test still passes and southern latitudes come out positive. No test has a position without its reference tags: with the `ref === undefined` check at line 120 removed, every test still passes and such a position is given in the northern or eastern hemisphere instead of being left out. To pass, add `readPhotoExif` tests beside the GPSAltitude one in `test/cli/metadata-exif.test.ts`: one where a hand-built GPS IFD with `GPSLatitudeRef` `S` gives a negative `gpsLatitude`, and one where `GPSLatitude` and `GPSLongitude` without their reference tags give neither field.
Model: opus-5-5
Two readPhotoExif tests on hand-built GPS IFDs: a GPSLatitude with
GPSLatitudeRef "S" gives a negative gpsLatitude, and a GPSLatitude and
GPSLongitude without their reference tags give neither field.
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.
photo.exif()now returns every EXIF tag in the file, as the owner ruled, instead of the thirteen common fields. The thirteen typed methods stay, with the same names and types.Closes #156 and closes #148.
What changed
exif()returnsExifTags, the one new exported type: each tag keyed by name, with exifreader'sid,value,descriptionandcomputed. A tag exifreader has no name for is keyedundefined-plus its number. No EXIF, or a video, gives{}.Thumbnail, so itsOrientationcannot hide the main image's.readPhotoExifnow takes the tags rather than the bytes; each typed method callsexif()and picks its field with it.TODO.mdand the example script's test follow; the example's JSON files now carry every tag.What the diff does not show
GPSLatitude/GPSLongitudeand their reference tags, as exifreader does. The thirteen's value tests are unchanged; new tests cover a southern latitude, and a position without reference tags, which gives neither field.readExifTagsnow also reads the thumbnail;backup-metadata --exifstill records only the main image's tags, so its output is unchanged.Disclosures
exif(), since it is not a tag.ExifTagsis built from exifreader's own tag type, so a tag it does not name is present at run time but not in the type.Model: opus-5-5
`photo.exif()` returns `ExifTags`: every EXIF tag exifreader reads from the file, keyed by tag name, each with exifreader's `id`, `value`, `description` and `computed`. The embedded thumbnail's tags are under `Thumbnail`, without the thumbnail image. A file with no EXIF, or a video, gives `{}`. The thirteen typed methods stay. Each picks its field from the tags `exif()` returns through `readPhotoExif`, which now takes the tags instead of the bytes. GPS latitude and longitude are worked out from their tags and reference tags, since exifreader's computed position is not among the tags. Also closes #148. Model: opus-5-53fb630d699to6dd22bcb73Review: fail.
src/exif.ts:120andsrc/exif.ts:146: no test covers two of the GPS rules that quak now applies itself, where exifreader applied them before. No test has a southern latitude: with the"S"at line 146 changed to anything else, every test still passes and southern latitudes come out positive. No test has a position without its reference tags: with theref === undefinedcheck at line 120 removed, every test still passes and such a position is given in the northern or eastern hemisphere instead of being left out. To pass, addreadPhotoExiftests beside the GPSAltitude one intest/cli/metadata-exif.test.ts: one where a hand-built GPS IFD withGPSLatitudeRefSgives a negativegpsLatitude, and one whereGPSLatitudeandGPSLongitudewithout their reference tags give neither field.Model: opus-5-5
Review: pass.
Model: opus-5-5