Bug 507713

Summary: Incorrect sorting of picture names
Product: [Applications] digikam Reporter: Frederic Da Vitoria <davito9w>
Component: Thumbs-IconViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.7.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.8.0
Sentry Crash Report:
Attachments: example of incorrectly sorted pictures

Description Frederic Da Vitoria 2025-07-31 20:34:46 UTC
Created attachment 183694 [details]
example of incorrectly sorted pictures

SUMMARY
When several pictures share the same name with an order number appended to the 2nd and subsequent pictures, digikam displays the first picture in last position.

STEPS TO REPRODUCE
1. pick any sequence of pictures named like picturename, picturename_1, picturename_2...
2. 
3. 

OBSERVED RESULT
digikam displays them using the following order: picturename_1, picturename_2, picturename

EXPECTED RESULT
digikam should display them using the following order: picturename, picturename_1, picturename_2

SOFTWARE/OS VERSIONS
Windows: 11

ADDITIONAL INFORMATION
This naming scheme is very frequent with cameras able to take more than one picture in one second.
Comment 1 Maik Qualmann 2025-07-31 20:43:50 UTC
This sorting corresponds to the "natural" sorting order, i.e., numbers and punctuation are respected.
If you want it differently, deactivate Natural String Sorting in the digiKam settings under Miscellaneous -> Behavior.

Maik
Comment 2 Frederic Da Vitoria 2025-07-31 21:25:56 UTC
I fail to understand how putting 20240317_162758_1 before 20240317_162758 can be "natural".
Comment 3 Maik Qualmann 2025-08-01 19:29:46 UTC
Git commit 8763113ff983fc9ac85f53310bdb78bf3d7f55a8 by Maik Qualmann.
Committed on 01/08/2025 at 19:28.
Pushed by mqualmann into branch 'master'.

fix natural item sorting with QCollator
Related: bug 507749
FIXED-IN: 8.8.0

M  +2    -2    NEWS
M  +25   -9    core/libs/database/models/itemsortcollator.cpp

https://invent.kde.org/graphics/digikam/-/commit/8763113ff983fc9ac85f53310bdb78bf3d7f55a8