[Linux] Name sort differs from Dolphin when basename is prefix of another (extension included in compare)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
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.
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.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 752
- Avg merge
- 10d 14h
- Merged PRs (30d)
- 1
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.
More from d2phap/ImageGlass
-
🐞 bug 👌🏻 ready
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
d2phap/ImageGlass#2451 ·
-
🎯 feature
Difficulty 4/5 3-5 days Newbie friendliness 52/100
d2phap/ImageGlass#2469 ·
-
🐞 bug 👌🏻 ready
Difficulty 3/5 1-2 days Newbie friendliness 55/100
d2phap/ImageGlass#2463 ·
-
🐞 bug 👌🏻 ready
Difficulty 3/5 1-2 days Newbie friendliness 68/100
d2phap/ImageGlass#2462 ·
-
🐞 bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
d2phap/ImageGlass#2461 ·
All issues in d2phap/ImageGlass
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·