Skip to content

Fix duplicate file paths in load_image_paths on case-insensitive filesystems#102

Open
ImCodingCat wants to merge 1 commit intozai-org:mainfrom
ImCodingCat:main
Open

Fix duplicate file paths in load_image_paths on case-insensitive filesystems#102
ImCodingCat wants to merge 1 commit intozai-org:mainfrom
ImCodingCat:main

Conversation

@ImCodingCat
Copy link

On case-insensitive filesystems (Windows NTFS, macOS HFS+), path.glob("*.jpg") and path.glob("*.JPG") both match the same files, causing every file to be added twice. This results in double the expected file count (e.g., 15912 instead of 7956).

Solution:
Deduplicate paths using set() before sorting. This preserves cross-platform compatibility — the uppercase glob is still needed for case-sensitive filesystems (Linux), while the deduplication handles case-insensitive ones.

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.

1 participant