Bug 507713 - Incorrect sorting of picture names
Summary: Incorrect sorting of picture names
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-IconView (other bugs)
Version First Reported In: 8.7.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-31 20:34 UTC by Frederic Da Vitoria
Modified: 2025-08-01 19:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.8.0
Sentry Crash Report:


Attachments
example of incorrectly sorted pictures (300.13 KB, image/png)
2025-07-31 20:34 UTC, Frederic Da Vitoria
Details

Note You need to log in before you can comment on or make changes to this bug.
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