Repository navigation
Do not read a macOS sidecar as the image it is named after - #56
Merged
Merged
Conversation
Copying a file onto a FAT or exFAT card makes macOS write a second file named ._<name> beside it, holding the resource fork and Finder info in AppleDouble form. It takes the whole name of the file it belongs to, so ._holiday.jpg ends in an image extension and holds no image. The extension decided the kind, so every one of them was registered as an image and then failed to decode. A card that has been in a Mac carries one per file, so half the rows in a case could be errors with nothing wrong. A "._" name now has its first bytes read before the extension is believed, and a file carrying the AppleDouble magic is filed as other. Both halves are required: the name alone would throw away a real image somebody named that way, and the magic alone is four bytes another format could open with. Only "._" names pay for the read. Four sites: the directory scan, a walked filesystem, a zip member and a tar member. The __MACOSX/ tree a Mac zip writer makes was already skipped; these are sidecars sitting in place in an ordinary path. Co-Authored-By: Claude Opus 5 <[email protected]>
abrignoni
changed the base branch from
fix/walked-stage-duplicates-head
to
main
September 10, 2026 10:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #55, which it shares a code block with. Merge that one first.
Copying a file onto a FAT or exFAT card makes macOS write a second file named
._<name>beside it, holding the resource fork and Finder info. It takes the whole name of the file it belongs to, so._holiday.jpgends in an image extension and holds no image.The extension decided the kind, so each one was registered as an image and then failed to decode. A card that has been in a Mac carries one per file, so a case can come out with half its rows in error and nothing actually wrong.
A
._name now has its first bytes read before its extension is believed, and a file carrying the AppleDouble magic is filed as other. Both halves are required: the name alone would throw away a real image somebody named that way, and the magic alone is four bytes another format could open with. Only._names pay for the read, and asking for all files still records them.Four sites: the directory scan, a walked filesystem, a zip member and a tar member. The
__MACOSX/tree a Mac zip writer makes was already skipped; these are sidecars sitting in place in an ordinary path.Tests at each site, all red before the change. The magic is written out in the tests rather than imported.
🤖 Generated with Claude Code