Skip to content

Skip Finder and Explorer metadata files instead of counting them as failed [patch] - #142

Merged
matt-edmondson merged 3 commits into
mainfrom
fix/135-skip-os-metadata-files
Oct 9, 2026
Merged

matt-edmondson merged 3 commits into
mainfrom
fix/135-skip-os-metadata-files

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #135

What changed

ProcessDirectory passed every file in --input to the decoder. .DS_Store, ._* AppleDouble files, Thumbs.db, ehthumbs.db and desktop.ini each counted as a failed icon, so any folder a Mac or Windows file manager had opened exited 2 even when every icon was written.

These entries are now skipped before decoding and counted as neither written nor failed. The new IconHelper.IsFileManagerMetadata skips:

  • names starting with .
  • Thumbs.db, ehthumbs.db and desktop.ini, case-insensitively

Ordinary non-image files keep the current behaviour: ContinuesAfterAFileThatCannotBeDecoded still counts notes.txt as failed. The optional items in the issue (Hidden/System attribute check, one-line decoder message) are left out to keep this PR small.

Tests

  • New SkipsFileManagerMetadataWithoutCountingItAsFailed: a folder with .DS_Store, ._good.png, desktop.ini, THUMBS.DB, ehthumbs.db and one valid PNG gives BatchResult(1, 0) and ExitSuccess.
  • With the fix reverted, the new test fails with BatchResult { Written = 1, Failed = 5 }. With the fix it passes.
  • Full suite: 82/82 passing locally. This needed -p:NuGetAudit=false and git lfs pull; see the note below.

⚠️ CI will be red, for a reason outside this PR

main no longer restores. NuGet audit now reports five advisories against SixLabors.ImageSharp 3.1.12 (GHSA-gwg2-r3hj-4w44, GHSA-j3p4-wp97-rph4, GHSA-j9gm-c75j-xc9q, GHSA-jjfr-hcj7-qf5w, GHSA-wmxv-xphr-5c9g), and warnings-as-errors turns them into NU1902/NU1903 errors. #141 fails the same way on all three OSes. No patched 3.1.x exists on nuget.org (3.1.12 is the last 3.x release; the next is 4.0.0). Moving to 4.x is a major-version and licence decision, so it isn't in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_019FkGdWB8Ko3mTn9JiBH973


Generated by Claude Code

…ailed [patch]

ProcessDirectory handed every file in the input folder to the decoder, so
.DS_Store, ._ AppleDouble files, Thumbs.db, ehthumbs.db and desktop.ini each
counted as a failed icon and printed a decoder dump. Any folder a Mac or
Windows file manager had opened then exited 2 even though every icon was
written. Skip dot-files and those names (case-insensitively) before
decoding, counting them as neither written nor failed. Ordinary non-image
files such as notes.txt still count as failed.

Fixes #135

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019FkGdWB8Ko3mTn9JiBH973
Comment thread IconHelper.Test/ProcessDirectoryTests.cs Fixed
Comment thread IconHelper.Test/ProcessDirectoryTests.cs Fixed
Comment thread IconHelper.Test/ProcessDirectoryTests.cs Fixed
Comment thread IconHelper.Test/ProcessDirectoryTests.cs Fixed
Comment thread IconHelper.Test/ProcessDirectoryTests.cs Fixed
Comment thread IconHelper.Test/ProcessDirectoryTests.cs Fixed

Copy link
Copy Markdown
Contributor Author

CI status: ci / .NET / Test on {ubuntu,windows,macos}-latest fail at restore. The cause isn't this PR's code: SixLabors.ImageSharp 3.1.12 now has five advisories (GHSA-gwg2-r3hj-4w44, GHSA-j3p4-wp97-rph4, GHSA-j9gm-c75j-xc9q, GHSA-jjfr-hcj7-qf5w, GHSA-wmxv-xphr-5c9g), and warnings-as-errors turns them into NU1902/NU1903 errors. main and #141 fail the same way.

No fix exists yet. 3.1.12 is the last 3.x release on nuget.org, so clearing this means upgrading to ImageSharp 4.x (a major-version and licence decision) or explicitly accepting the advisories. Either belongs in its own PR. With the audit disabled locally, the full suite passes (82/82).

The code-quality findings on the new test are addressed in 564f400 (Path.Join for the fixture paths).


Generated by Claude Code

NuGet audit reports five advisories against SixLabors.ImageSharp 3.1.12,
and with warnings as errors NU1902/NU1903 fail restore on every build.
No 3.1.x release patches them; the fix is 4.x, which moved to a split
licence, so the 3.1.x pin stays and each advisory is suppressed by name.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013j5p1tUWLykEtnhAziUkZa
Comment thread Directory.Build.props
Comment on lines +10 to +14
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-j3p4-wp97-rph4" />
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-j9gm-c75j-xc9q" />
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-jjfr-hcj7-qf5w" />
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-gwg2-r3hj-4w44" />
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-wmxv-xphr-5c9g" />
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 62ce189 into main Oct 9, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/135-skip-os-metadata-files branch October 9, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.DS_Store, Thumbs.db and desktop.ini in the input folder count as failed icons, so a clean batch exits 2 and prints a decoder dump for each

3 participants