Bug 430134

Summary: Face tags lost and captions mis-transferred after digiKam automatically renames a conflicting filename
Product: [Applications] digikam Reporter: Mike Morrison <mike>
Component: Database-ScanAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 7.2.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In: 7.2.0
Sentry Crash Report:

Description Mike Morrison 2020-12-08 01:23:47 UTC
SUMMARY
When digiKam automatically renames an image to resolve a duplicate filename during a move, the existing image's face tags can be lost. Additionally, the caption from the moved image can be incorrectly moved to the existing image.

STEPS TO REPRODUCE
1. Start with 2 different images, having the same filename, in 2 different albums. For example:
In album "Friends", have a photo of a person, called "photo.jpg".
In album "Plants", have a photo of a flower, called "photo.jpg".

2. Apply a face tag (e.g. "Mike") to a region of the person photo.

3. Apply a caption (e.g. "A nice flower") to the flower photo.

4. Right-click the flower photo and choose "Move to Album..."

5. Choose the "Friends" album as the destination.

6. digiKam will warn of a file conflict. Choose "Rename automatically".

7. Look in the "Friends" album. Both photos are there. The flower photo has been renamed to "photo_v1.jpg". But:

OBSERVED RESULT
The person's photo has lost its face tag.
The caption "A nice flower" has been removed from the flower photo, and applied to the person's photo.

EXPECTED RESULT
The person's photo should keep its face tag.
The flower photo should keep its caption.
The flower caption should not be applied to the person's photo.

SOFTWARE/OS VERSIONS
Ubuntu 20.10
digikam-7.2.0-beta2-20201202T061220-x86-64.appimage
KDE Plasma Version: 
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
Database: SQLite
Write This Information to the Metadata: None
Comment 1 Maik Qualmann 2020-12-08 07:37:51 UTC
This is a problem with the Scan Controller. The hints that we give him on the way to the later scan are no longer correct because the file name has changed.

Maik
Comment 2 Maik Qualmann 2020-12-08 20:47:20 UTC
Git commit 9fa4cedd71b5a645e8c3c8a4912b3044b4c82e1f by Maik Qualmann.
Committed on 08/12/2020 at 20:46.
Pushed by mqualmann into branch 'master'.

fix scan item after move and renaming to album
FIXED-IN: 7.2.0

M  +2    -1    NEWS
M  +8    -1    core/libs/database/utils/ifaces/dio.cpp
M  +3    -1    core/libs/iojobs/iojob.cpp
M  +5    -3    core/libs/iojobs/iojobdata.cpp

https://invent.kde.org/graphics/digikam/commit/9fa4cedd71b5a645e8c3c8a4912b3044b4c82e1f