Skip to content

Scan image files whose extensions are upper-case - #152

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/148-uppercase-extensions
Sep 26, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/148-uppercase-extensions

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #148

Summary

ImageScanner.ScanForImages looked up each file's extension in a lower-case HashSet<FileExtension>, and FileExtension equality is ordinal. Files named IMG_0001.JPG, x.Png or y.JPEG were skipped on every OS. The fix lowers the extension with ToLowerInvariant() before the lookup.

Test

  • New ScanForImagesMatchesExtensionsCaseInsensitively: .JPG, .Png, .jpeg and .TIFF files must all be returned, and NOTES.TXT must not be.
  • Checked that it fails without the fix ("Different number of elements") and passes with it.
  • Full suite: 38/38 pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_0113g7mUxeizhTrH6na279Ez


Generated by Claude Code

ImageScanner matched extensions against a lower-case set using FileExtension's
ordinal equality, so .JPG, .PNG and .JPEG files were silently skipped. Lower the
extension before the lookup.

Fixes #148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113g7mUxeizhTrH6na279Ez
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit a8fea37 into main Sep 26, 2026
12 checks passed
@matt-edmondson
matt-edmondson deleted the fix/148-uppercase-extensions branch September 26, 2026 09:54
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.

Images with upper-case extensions (.JPG, .PNG, .JPEG) are never scanned

2 participants