Bug 510691

Summary: Renaming files with the same name but with a new, different sort order in a folder
Product: [Applications] digikam Reporter: Bertil Rolf <b.g.rolf>
Component: AdvancedRename-albumAssignee: Digikam Developers <digikam-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 8.7.0   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: attachment-170199-0.html

Description Bertil Rolf 2025-10-16 17:52:57 UTC
DigiKam 8.7.0 for Windows 11. 

This is the task I want to do. I collect a set of photos from a tour, say Vienna June 2025. I want to order them by drag/drop and then given them a sequential file name, say “Vienna June 2025 _1, ”, “Vienna June 2025 _2” etc. 

Ordering is OK in DigiKam. I set sort order to “Manual and Name”.

But renaming is a problem. I mark them all and set the name to “Vienna June 2025 #”. First, DigiKam refuses to name all files. It stops and reports:

“ An error occurred while renaming 10 images.
Do you want to rename these images again or rename these images by overwriting?”

Renaming again fails time and again. 

If I then choose overwrite, the result is that my ordering is broken and the files appear in some queer unwanted order.

----
Perhaps I have a clue. 

First, I think it would be a good idea to have DigiKam refresh the folder/album when any changes have taken place that might change sort order. I get surprises when I refresh manually.

Second, the errors seem related to renaming files after having changed sort order. For instance, I first name my photos “Vienna June 1, 2, 3” etc just to separate them from files from other shoots. Then I move all the Vienna files to a subfolder. I have them sorted by “Manual and Name”. Now I reorder them by drag + drop. When I have the desired order, I rename them with the same names “Vienna June 1, 2, 3” but in a new order.

Then the problem described above starts!

But I can avoid it (as far as I have tried) by first renaming the files in the new sort order given as “Vienna 13, 9, 2”  into “ABC 1, 2, 3”. The final step is then to assign them the final name I want, i.e. “Vienna June 1, 2, 3”. 

That is, if a I choose an intermediate step with a name unrelated to the initial and final names, I seem to steer clear of trouble and get the names on the files in the right order corrected.

I hope you can understand the problem clearly enough to fix it. Otherwise, I like DigiKam’s DAM features very much.

Best regards
Bertil Rolf
Baden bei Wien
Comment 1 Maik Qualmann 2025-10-16 18:56:49 UTC
I recently had the same problem in Windows when renaming a large number of files that originated from a hard drive recovery. I haven't yet investigated the cause, but my guess is a file locking issue in Windows. The files are probably still open in another task during the renaming process. I suspect the thumbnail task. I'll look into it.

Maik
Comment 2 Bertil Rolf 2025-10-17 06:12:52 UTC
Created attachment 185850 [details]
attachment-170199-0.html

Interestingly, I never encountered this problem in Lightroom, using
basically the same workflow but with their type of albums. //Bertil Rolf

On Thu, Oct 16, 2025 at 8:56 PM Maik Qualmann <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=510691
>
> Maik Qualmann <metzpinguin@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>      Ever confirmed|0                           |1
>                  CC|                            |metzpinguin@gmail.com
>              Status|REPORTED                    |CONFIRMED
>
> --- Comment #1 from Maik Qualmann <metzpinguin@gmail.com> ---
> I recently had the same problem in Windows when renaming a large number of
> files that originated from a hard drive recovery. I haven't yet
> investigated
> the cause, but my guess is a file locking issue in Windows. The files are
> probably still open in another task during the renaming process. I suspect
> the
> thumbnail task. I'll look into it.
>
> Maik
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Maik Qualmann 2025-10-26 13:04:36 UTC
Git commit a77cfb17ac48e7a7ec74ac897f578bd43ab52936 by Maik Qualmann.
Committed on 26/10/2025 at 13:03.
Pushed by mqualmann into branch 'master'.

load thumbnails only from the database when renaming

M  +7    -1    core/utilities/advancedrename/advancedrenameprocessdialog.cpp

https://invent.kde.org/graphics/digikam/-/commit/a77cfb17ac48e7a7ec74ac897f578bd43ab52936