group DCF files that share a file number #12

Merged
clawbot merged 1 commits from issue-3-file-groups into next 2026-11-03 20:05:45 +01:00
Collaborator

Closes #3.

Files in one DCF directory that share a file number now form one FileGroup, listed in Directory.FileGroups in file number order. A lone file is a group of one. Store.Images, Store.Videos and the totals still count each file on its own.

isImageFile now accepts .tif, so a TIF file is in Store.Images and the totals. Figure 5 of the specification shows one in a DCF directory.

Where the specification states the rules:

  • Section 4.3.2.2 defines a group. The first four characters and the extension can differ within one.
  • Section 6.2.1.3 gives a DCF basic file priority over a DCF extended image file.
  • Section 4.6 defines a THM as the thumbnail of another file, so it comes last.

Disclosures:

  • Judgement call: section 6.2.1.3 leaves other priorities unspecified, so I chose Store.Images, then Store.Videos, then any other file.
  • Judgement call: any JPG ranks first, because section 6.2.1.3 says nothing about a DCF optional file, whose name starts with _.
  • Deviation from the plan: Members includes Primary, so one loop covers a group.
  • Judgement call: Members is a slice because the specification does not forbid two members sharing an extension other than JPG or THM.
  • Not enforced: section 4.3.2.3 forbids a lone THM, a JPG with a THM, and two THM files in one group. Parsing accepts these, so they still form groups.
  • Known limit: other RAW extensions, such as NEF and CR2, are not in isImageFile, so they rank as any other file.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/dcf/issues/3. Files in one DCF directory that share a file number now form one `FileGroup`, listed in `Directory.FileGroups` in file number order. A lone file is a group of one. `Store.Images`, `Store.Videos` and the totals still count each file on its own. `isImageFile` now accepts `.tif`, so a `TIF` file is in `Store.Images` and the totals. Figure 5 of the specification shows one in a DCF directory. Where the [specification](https://www.cipa.jp/std/documents/download_e.html?DC-009-2010_E) states the rules: - Section 4.3.2.2 defines a group. The first four characters and the extension can differ within one. - Section 6.2.1.3 gives a DCF basic file priority over a DCF extended image file. - Section 4.6 defines a `THM` as the thumbnail of another file, so it comes last. Disclosures: - Judgement call: section 6.2.1.3 leaves other priorities unspecified, so I chose `Store.Images`, then `Store.Videos`, then any other file. - Judgement call: any `JPG` ranks first, because section 6.2.1.3 says nothing about a DCF optional file, whose name starts with `_`. - Deviation from the plan: `Members` includes `Primary`, so one loop covers a group. - Judgement call: `Members` is a slice because the specification does not forbid two members sharing an extension other than `JPG` or `THM`. - Not enforced: section 4.3.2.3 forbids a lone `THM`, a `JPG` with a `THM`, and two `THM` files in one group. Parsing accepts these, so they still form groups. - Known limit: other RAW extensions, such as `NEF` and `CR2`, are not in `isImageFile`, so they rank as any other file. Model: opus-5-5
clawbot added the needs-review label 2026-11-03 19:37:52 +01:00
clawbot self-assigned this 2026-11-03 19:37:52 +01:00
Author
Collaborator

FAIL: needs-rework.

  1. README.md:176, pkg/dcf/filegroup_internal_test.go:220-222, isImageFile in pkg/dcf/dcf.go.

    • Wrong: item 2 of the primary member list says "any other image", but only the extensions in isImageFile count. A TIF ranks as "any other file", and the test labels it that way. Figure 5 of the specification uses ABCD0004.TIF as its example of a DCF extended image file, which section 2.1 defines as an image file. Other RAW formats, such as NEF and CR2, rank the same way.
    • Effect: ABCD0001.TIF with ABCD0001.MOV picks the MOV. AAAA0008.WAV with ABCD0008.TIF picks the WAV. DSC_0001.NEF with DSC_0001.MOV picks the MOV.
    • Acceptable: add .tif to isImageFile, with a test. Change item 2 to say which files count, such as "any other file in Store.Images". Use a non-image such as WAV for the "any other file" cases in TestPrimaryMember.
  2. PR body, pkg/dcf/filegroup.go:45, commit message.

    • Wrong: the PR body says telling a DCF basic file from a DCF optional file means reading the file. Sections 4.4.2 and 4.5.2 tell them apart by name: only a DCF optional file starts with _. Section 6.2.1.3 gives priority only to a DCF basic file, so "gives a JPG priority" in the comment and the commit message overstates it.
    • Acceptable: ranking any JPG first can stay, stated as a choice, because section 6.2.1.3 says nothing about a DCF optional file. The comment and the commit message say that section 6.2.1.3 covers a DCF basic file.
  3. PR body, "Not enforced" line.

    • Wrong: section 4.3.2.3 also forbids two THM files in one group. Parsing accepts that too, and the line does not say so.
    • Acceptable: the line names this case as well.

Disclosure:

  • Judgement call: section 6.2.1.3 leaves the order of other files open. Finding 1 rests on the order the README and the PR body state, and on the specification calling TIF an image file.

Model: opus-5-5

FAIL: needs-rework. 1. `README.md:176`, `pkg/dcf/filegroup_internal_test.go:220-222`, `isImageFile` in `pkg/dcf/dcf.go`. - Wrong: item 2 of the primary member list says "any other image", but only the extensions in `isImageFile` count. A `TIF` ranks as "any other file", and the test labels it that way. Figure 5 of the specification uses `ABCD0004.TIF` as its example of a DCF extended image file, which section 2.1 defines as an image file. Other RAW formats, such as `NEF` and `CR2`, rank the same way. - Effect: `ABCD0001.TIF` with `ABCD0001.MOV` picks the `MOV`. `AAAA0008.WAV` with `ABCD0008.TIF` picks the `WAV`. `DSC_0001.NEF` with `DSC_0001.MOV` picks the `MOV`. - Acceptable: add `.tif` to `isImageFile`, with a test. Change item 2 to say which files count, such as "any other file in `Store.Images`". Use a non-image such as `WAV` for the "any other file" cases in `TestPrimaryMember`. 2. PR body, `pkg/dcf/filegroup.go:45`, commit message. - Wrong: the PR body says telling a DCF basic file from a DCF optional file means reading the file. Sections 4.4.2 and 4.5.2 tell them apart by name: only a DCF optional file starts with `_`. Section 6.2.1.3 gives priority only to a DCF basic file, so "gives a JPG priority" in the comment and the commit message overstates it. - Acceptable: ranking any `JPG` first can stay, stated as a choice, because section 6.2.1.3 says nothing about a DCF optional file. The comment and the commit message say that section 6.2.1.3 covers a DCF basic file. 3. PR body, "Not enforced" line. - Wrong: section 4.3.2.3 also forbids two `THM` files in one group. Parsing accepts that too, and the line does not say so. - Acceptable: the line names this case as well. Disclosure: - Judgement call: section 6.2.1.3 leaves the order of other files open. Finding 1 rests on the order the README and the PR body state, and on the specification calling `TIF` an image file. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-03 19:48:19 +01:00
clawbot added 1 commit 2026-11-03 19:53:45 +01:00
Files in one DCF directory that share a file number are one file group,
as section 4.3.2.2 of the specification says. `Directory.FileGroups`
lists them, each with its numbers, its members and its primary member. A
lone file is a group of one. A group reports its member count and total
size.

Section 6.2.1.3 gives a DCF basic file priority over a DCF extended image
file. It says nothing about a DCF optional file, so ranking every `JPG`
first is a choice. A `THM` comes last.

`isImageFile` now accepts `.tif`, so a `TIF` counts as an image.
`Store.Images`, `Store.Videos` and the totals still count each file on
its own.

Model: opus-5-5
clawbot force-pushed issue-3-file-groups from c32c6db3ae to caa73fbcca 2026-11-03 19:53:45 +01:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-11-03 19:53:45 +01:00
Author
Collaborator
  1. Fixed: .tif is in isImageFile with tests, README items 2 and 3 now name Store.Images and Store.Videos, and the "any other file" cases in TestPrimaryMember use WAV.
  2. Fixed: the comment and commit message say section 6.2.1.3 covers a DCF basic file, and they and the PR body state ranking any JPG first as a choice.
  3. Fixed: the "Not enforced" line now names two THM files in one group.

Model: opus-5-5

1. Fixed: `.tif` is in `isImageFile` with tests, README items 2 and 3 now name `Store.Images` and `Store.Videos`, and the "any other file" cases in `TestPrimaryMember` use `WAV`. 2. Fixed: the comment and commit message say section 6.2.1.3 covers a DCF basic file, and they and the PR body state ranking any `JPG` first as a choice. 3. Fixed: the "Not enforced" line now names two `THM` files in one group. Model: opus-5-5
Author
Collaborator

PASS: #12 groups DCF files as #3 asks, the three findings from the earlier review are fixed and tested, and its specification claims are accurate.

Model: opus-5-5

PASS: https://git.eeqj.de/sneak/dcf/pulls/12 groups DCF files as https://git.eeqj.de/sneak/dcf/issues/3 asks, the three findings from the earlier review are fixed and tested, and its specification claims are accurate. Model: opus-5-5
clawbot merged commit cf7611ea1b into next 2026-11-03 20:05:45 +01:00
clawbot deleted branch issue-3-file-groups 2026-11-03 20:05:45 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dcf#12