Bug 458200

Summary: Size or position change made to face rectangle is only written to database and not to image file/sidecar
Product: [Applications] digikam Reporter: Kristian Karl <kristian.hermann.karl>
Component: Faces-WorkflowAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 8.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 8.0.0
Sentry Crash Report:
Attachments: GIF replicating the issue

Description Kristian Karl 2022-08-23 09:25:14 UTC
Created attachment 151519 [details]
GIF replicating the issue

SUMMARY
When making a position or size change of a face tag, then leaving the image without pressing the OK button on the face tag widget, the change will only be made to the database and not to the image file nor it's sidecar file.

This will cause the user to mistakenly believe that the changes are applied to the images, when they only are committed to database.

STEPS TO REPRODUCE
1. Open an album with images that contains face tags.
2. Open that image.
2. Change the position of the face tag.
3. Click outside the face tag, this will close the image preview, and take the user back to the album view.

OBSERVED RESULT
The metadata change (face tag position) has been written to the database, but not to the image/sidecar file.
If lazy synchronization is enabled, nor message is displayed on the status bar should.

EXPECTED RESULT
The metadata change (face tag position) should have been written to both the database and the image/sidecar file.
If lazy synchronization is enabled, the status bar should display "1 file awaits synchronization".

SOFTWARE/OS VERSIONS

Operating System: Ubuntu 22.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-46-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-2600K CPU @ 3.40GHz
Memory: 15,6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 960/PCIe/SSE2

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2022-08-23 09:35:42 UTC
This is normal, look at the file metadata it was written. There are metadata operations that bypass lazy synchronization, editing face tags is one of them. We need the changes immediately in the image metadata, otherwise later scans could lead to incorrect face rectangles in the database.

Maik
Comment 2 Maik Qualmann 2022-08-23 09:49:21 UTC
Ok, click outside... it reproduces. When rotating, lazy synchronization is bypassed.

Maik
Comment 3 Maik Qualmann 2022-08-23 20:34:51 UTC
Git commit 2486e7559eb59f58577dea12242e625c07d493f4 by Maik Qualmann.
Committed on 23/08/2022 at 20:33.
Pushed by mqualmann into branch 'master'.

write the tag to trigger a metadata write task
FIXED-IN: 8.0.0

M  +1    -1    NEWS
M  +2    -1    core/libs/database/tags/facetagseditor.cpp

https://invent.kde.org/graphics/digikam/commit/2486e7559eb59f58577dea12242e625c07d493f4
Comment 4 Kristian Karl 2022-08-24 07:46:45 UTC
I verified the fix, and it looks great. 
Thank you :-)