Skip to content

Scan silently skips images in dot-folders and dot-named files (and Hidden/System files on Windows) since the unreadable-folder fix #175

Description

@matt-edmondson

What's wrong

ImageScanner.ScanForImages (ImageDescriber/ImageScanner.cs:34-43) switched from the SearchOption.AllDirectories overload to an EnumerationOptions instance so that unreadable folders are skipped (c66d467, #162):

EnumerationOptions options = new()
{
	RecurseSubdirectories = true,
	IgnoreInaccessible = true,
};

EnumerationOptions.AttributesToSkip defaults to FileAttributes.Hidden | FileAttributes.System, whereas the SearchOption overload skips nothing. On Linux and macOS .NET reports every .-prefixed file and directory as Hidden, so they are now excluded along with everything below them. On Windows, anything with the Hidden or System attribute is excluded.

Reproduced with .NET 10 on a tree containing root/.hidden/a.jpg, root/.c.png and root/vis/b.jpg:

  • the old Directory.EnumerateFiles(root, "*", SearchOption.AllDirectories) returns all 3 files
  • the current code returns only vis/b.jpg

Why it matters

ImageDescriber Scan -p ~/Pictures quietly misses images under any dot-folder (e.g. .thumbnails, synced-app folders, .photoslibrary-style bundles) and any dot-named image. Nothing is logged; the "Found N image(s)" count is just lower, so users have no way to notice. The change was a side-effect of the #162 fix, not a deliberate behaviour change.

Suggested fix

Set AttributesToSkip = 0 (or FileAttributes.None) in the options, keeping IgnoreInaccessible = true. If skipping hidden content is actually wanted, make it an explicit, documented choice instead.

Acceptance criteria

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions