Bug 433350 - 'reread metadata from file' don't clean up ImageProperties table if the related fields don't exist anymore in the file
Summary: 'reread metadata from file' don't clean up ImageProperties table if the relat...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Scan (show other bugs)
Version: 7.2.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-20 19:37 UTC by mahikeulbody
Modified: 2021-02-20 20:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.2.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mahikeulbody 2021-02-20 19:37:17 UTC
SUMMARY
'reread metadata from file' only refresh Location fields (sublocation, city, state, country) if at least one of them is present in the file.

STEPS TO REPRODUCE
1. open item/edit metadata' dialog for a file
2. set sublocation, city and state of an image to some values (let say A, B, C resp.)
3. set title to some value (let say D)
4. remove all xmp metadata of this file with an external tool (exiftool for example)
5. do 'Item/Reread metadata from file' for the file
6. check values of sublocation, city, state, title into Captions panel

OBSERVED RESULT
title=empty   (ok)
sublocation=A, city=B and state=C   (nok)

EXPECTED RESULT
title=empty
sublocation=empty, city=empty, and state=empty

NB. If you do the same process removing all location fields except at least one of them (city for example), the observed result is ok (i.e. sublocation and state are empty and city has the value, eventually new, present in the file).


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro/KDE
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2021-02-20 19:46:36 UTC
This behavior is by intended and normal. There are users who only write their metadata into the database. If the metadata were re-read, data would be lost. There is an option in the metadata settings to clean up the database when re-reading. You should only activate the option temporarily if it is needed.

Maik
Comment 2 Maik Qualmann 2021-02-20 19:58:12 UTC
Git commit cc13d81afda32ec60cb9756bb9a34e1c7162b2f8 by Maik Qualmann.
Committed on 20/02/2021 at 19:57.
Pushed by mqualmann into branch 'master'.

clean up also ImageProperties
FIXED-IN: 7.2.0

M  +6    -2    core/libs/database/coredb/coredb.cpp

https://invent.kde.org/graphics/digikam/commit/cc13d81afda32ec60cb9756bb9a34e1c7162b2f8
Comment 3 mahikeulbody 2021-02-20 20:16:11 UTC
(In reply to Maik Qualmann from comment #1)
> There is an option in the metadata settings to clean up the database when re-reading.

This option was activated ; a prove of that : the field 'title' has been cleaned.

So your explanation is not right.
Comment 4 mahikeulbody 2021-02-20 20:19:45 UTC
> So your explanation is not right.

I saw you fixed the bug after to write my comment.

Thanks.
Comment 5 Maik Qualmann 2021-02-20 20:21:00 UTC
Yes, it is fixed now ((:-))

Maik