[Linux] Name sort differs from Dolphin when basename is prefix of another (extension included in compare)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 752
- Avg merge
- 10d 14h
- Merged PRs (30d)
- 1
Description
Windows OS version
N/A - CachyOS Linux / KDE Dolphin 26.08.1
ImageGlass version
10.0.6.906 linux-x64 AppImage
ImageGlass release
Classic
1️⃣ Steps to reproduce
- Create folder with
park.jpgandpark 2.jpg(same extension). - In ImageGlass Settings > Image > Image loading order =
Name (default),Ascending. - Open
park.jpgin ImageGlass, navigate next/prev, or check gallery order. - Compare with Dolphin sorted by Name, or
sort -V/ls -v.
Same with park.jpg vs park - 2.jpg.
2️⃣ Actual behavior
- ImageGlass shows
park 2.jpgfirst,park.jpgsecond. - ImageGlass shows
park - 2.jpgfirst,park.jpgsecond.
3️⃣ Expected behavior
- Dolphin / Explorer /
sort -V/ls -vshowpark.jpgfirst,park 2.jpgsecond. - Dolphin shows
park.jpgfirst,park - 2.jpgsecond.
4️⃣ Screenshots / Video / Sample image file
No image format issue — filenames suffice:
park.jpg
park 2.jpg
park - 2.jpg
5️⃣ Additional context
Suspected root cause in source/ImageGlass.Lib/Common/ServiceProviders/FileSearchService/FileSearchProvider.cs (SortEntries() / SortFiles()):
.ThenBy(f => Path.GetFileName(f), filePathComparer)
uses full filename with StringNaturalComparer (OrdinalIgnoreCase), so park.jpg vs park 2.jpg compares pos 4: '.' (46) vs ' ' (32). Space wins.
Dolphin/Explorer/sort -V sort basename first, extension second (park is prefix of park 2, shorter-first).
Suggested fix:
.ThenBy(f => Path.GetFileNameWithoutExtension(f), filePathComparer)
.ThenBy(f => Path.GetExtension(f), StringComparer.OrdinalIgnoreCase)
Config: igconfig.json: ImageLoadingOrder: Name, ImageLoadingOrderType: Asc, EnableExplorerSortOrder: false. EnableExplorerSortOrder is Windows-only (Win32FileSearchProvider), so no workaround on Linux.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in source/ImageGlass.Lib/Common/ServiceProviders/FileSearchService/FileSearchProvider.cs, focusing on SortEntries() and SortFiles() and the filename comparer. Reproduce the Linux ordering with park.jpg, park 2.jpg, and park - 2.jpg, then verify that basename-first sorting places park.jpg before the numbered variants in the image loading order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100