SUMMARY Maintenance > Sync Metadata and Database (Sync Direction: From image metadata to database) does not work for disabled or deleted tags. STEPS TO REPRODUCE Prerequisites - You have two digiKam-SQLite-databases (e.g. "first_database" and "second_database") - Both databases should contain the same album with a photo I'll call "JPG" here - Metadata should be written into JPGs 1. Start digiKam using SQLite-database "first_database". 2. Create a new tag, e.g. "test". Write the tag into a JPG. 3. Start digiKam using the "second_database". 4. Here the new tag does not exist. 5. Tools > Maintenance... > Sync Metadata and Database, Sync Direction: From image to database Click "OK" 6. Now the new tag should appear in the Tags tree. 7. Select the JPG containing the tag "test". Deselect or delete the tag. Wait until/ensure there's no pending metadata synchronization and no active process. 8. You can test the result with a file manager: the JPG should not contain a tag "test" now. 9. Start digiKam using "first_database". Here the tag "test" is present in the tag tree and set for the JPG because that's the information the database provides. 10. Tools > Maintenance... > Sync Metadata and Database, Sync Direction: From image to database Click "OK" OBSERVED RESULT No changes are visible. The tag "test" remains present in the tag tree and set for the JPG. EXPECTED RESULT In case the tag was disabled in second_database: The tag should be disabled for the JPG in first_database, too. In case the tag was deleted in second_database: The tag should be deleted in first_database as well. SOFTWARE/OS VERSIONS Windows 10 professional digiKam 7.8.0 Thanks in advance for having a look at this problem.
This is a misconception that new digiKam users have from time to time. We should create a FAQ. This behavior is by design. digiKam does not delete any metadata in the database by default if they are no longer in the image during a scan. Only metadata that is new or changed is updated. Not all users write their metadata in the images, just use it in the database. A new scan would delete all metadata in the database. In your case, there is the option to clean up the metadata during a scan in the digiKam settings under metadata. However, if a tag is no longer in the images, it will not be deleted from the tag tree as well, that's definitely the intention. This deletion process must be done manually in the Tags Manager or in a Tag Sidebar. Maik
In the future with digiKam-8.0.0 the time-consuming synchronization can probably be omitted. Several alternative paths for other computers can be added to a network path collection there. So they only have to use one database. Maik
Thank you very much for your response, Maik! I do understand now that digiKam does not delete any metadata on purpose. But you wrote that changed metadata should be updated. In my case I've deactivated a tag - but the tag remains enabled after maintenance process (see EXPECTED RESULT #1). Is this behaviour by design as well?
I'm not sure what you mean by "deactivate". We might be able to clarify it in a private e-mail, based on your e-mail address I assume that you speak German. You have tags in a tree, sometimes imported from images or created manually. If you remove the check mark, the tag will be removed from the image. If writing tag metadata is enabled, the tag will also be removed from the image itself. And yes, if the image is read into another database, the tag remains set there. Otherwise we would delete the database tags if we only worked with the database in this digiKam. I realize it's difficult to understand. So, since we keep getting reports of this problem, a solution has to be created. Although we have an option with the possibility to clean up the database, it is not understandable for (new) users why this exists. For digiKam-8.0.0 I will remove this option and make replacing the metadata in the database dependent on the respective metadata writing option being activated. Maik
Thanks again for explanation. Yes, I speak german. By deactivating I mean unchecking... But I think I've found the solution: digikam deactivates the tag in the other database if the following option is enabled: Settings > Configure digiKam... > Metadata > Behaviour > Clean up the metadata from the database when rescan files I'm very excited for version 8...
Git commit 536af9ca0b07baef20d087bd1f4c779b3ca0f5ed by Maik Qualmann. Committed on 10/09/2022 at 20:32. Pushed by mqualmann into branch 'master'. replace metadata in the database is now dependent on the metadata save settings The option to clean up the database is now removed. FIXED-IN: 8.0.0 M +2 -1 NEWS M +22 -61 core/libs/database/coredb/coredb.cpp M +12 -9 core/libs/database/coredb/coredb.h M +1 -0 core/libs/database/item/scanner/itemscanner.h M +71 -0 core/libs/database/item/scanner/itemscanner_database.cpp M +2 -4 core/libs/database/item/scanner/itemscanner_file.cpp M +10 -7 core/libs/database/item/scanner/itemscanner_photo.cpp M +0 -5 core/libs/metadataengine/engine/metaenginesettingscontainer.cpp M +0 -1 core/libs/metadataengine/engine/metaenginesettingscontainer.h M +0 -20 core/utilities/setup/metadata/setupmetadata.cpp M +0 -1 core/utilities/setup/metadata/setupmetadata.h M +0 -10 core/utilities/setup/metadata/setupmetadata_behavior.cpp M +0 -3 core/utilities/setup/metadata/setupmetadata_p.cpp M +0 -2 core/utilities/setup/metadata/setupmetadata_p.h https://invent.kde.org/graphics/digikam/commit/536af9ca0b07baef20d087bd1f4c779b3ca0f5ed