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.
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
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.
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.
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
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
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.
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.
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
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 next2026-11-03 20:05:45 +01: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.
Closes #3.
Files in one DCF directory that share a file number now form one
FileGroup, listed inDirectory.FileGroupsin file number order. A lone file is a group of one.Store.Images,Store.Videosand the totals still count each file on its own.isImageFilenow accepts.tif, so aTIFfile is inStore.Imagesand the totals. Figure 5 of the specification shows one in a DCF directory.Where the specification states the rules:
THMas the thumbnail of another file, so it comes last.Disclosures:
Store.Images, thenStore.Videos, then any other file.JPGranks first, because section 6.2.1.3 says nothing about a DCF optional file, whose name starts with_.MembersincludesPrimary, so one loop covers a group.Membersis a slice because the specification does not forbid two members sharing an extension other thanJPGorTHM.THM, aJPGwith aTHM, and twoTHMfiles in one group. Parsing accepts these, so they still form groups.NEFandCR2, are not inisImageFile, so they rank as any other file.Model: opus-5-5
FAIL: needs-rework.
README.md:176,pkg/dcf/filegroup_internal_test.go:220-222,isImageFileinpkg/dcf/dcf.go.isImageFilecount. ATIFranks as "any other file", and the test labels it that way. Figure 5 of the specification usesABCD0004.TIFas its example of a DCF extended image file, which section 2.1 defines as an image file. Other RAW formats, such asNEFandCR2, rank the same way.ABCD0001.TIFwithABCD0001.MOVpicks theMOV.AAAA0008.WAVwithABCD0008.TIFpicks theWAV.DSC_0001.NEFwithDSC_0001.MOVpicks theMOV..tiftoisImageFile, with a test. Change item 2 to say which files count, such as "any other file inStore.Images". Use a non-image such asWAVfor the "any other file" cases inTestPrimaryMember.PR body,
pkg/dcf/filegroup.go:45, commit message._. 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.JPGfirst 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.PR body, "Not enforced" line.
THMfiles in one group. Parsing accepts that too, and the line does not say so.Disclosure:
TIFan image file.Model: opus-5-5
c32c6db3aetocaa73fbcca.tifis inisImageFilewith tests, README items 2 and 3 now nameStore.ImagesandStore.Videos, and the "any other file" cases inTestPrimaryMemberuseWAV.JPGfirst as a choice.THMfiles in one group.Model: opus-5-5
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