| Summary: | reread of XMP metadata leaves tag hierarchy scrambled | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Ervan Darnell <edarnell> |
| Component: | Metadata-Xmp | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | caulier.gilles, dch.code, metzpinguin |
| Priority: | NOR | ||
| Version First Reported In: | 6.4.0 | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 8.1.0 | |
| Sentry Crash Report: | |||
| Attachments: |
screen dump of extra hierarchy level in tags
extra hierarchy level for tag "11 Bob" even on version 7.2.0 Creation of test tags Test tags assigned to image Tags after metadata is re-read |
||
|
Description
Ervan Darnell
2021-02-10 20:30:17 UTC
I cannot reproduce the problem here. It is created quite normally /2020/11 Bob. Tested here with MySQL, what kind of database do you use? Otherwise, please post the output from the terminal with activated debug mode when a re-read of the metadata is carried out. As described here: https://www.digikam.org/contribute/ Furthermore digiKam-6.4.0 is quite old, please try the current AppImage release candidate from digiKam-7.2.0-RC from here: https://files.kde.org/digikam/ Maik Created attachment 135579 [details]
extra hierarchy level for tag "11 Bob" even on version 7.2.0
Thanks for the quick reply. I installed 7.2.0, and let it reread the metadata. The results are unchanged. The debug log follows. I'm using the default SQlite database.
I cannot find the exact issue, but this arose because of the handling between dc:subject and digiKam:TagsList tags in the XMP file. Originally, it was 2010.11 Bob, where '.' was a hierarchy separator, but that got changed to just '11 Bob' for dc:subject, but digiKam:TagsList kept the full form
<rdf:li>2020/11 Bob</rdf:li>
So, it's a munged XMP file at fault in a way, but still when digiKam reparses the XMP file on reread it should not create something completely broken, which 2020/2020/11 Bob is.
Digikam::ScanController::slotRelaxedScanning: Starting scan!
Digikam::DMetadata::loadUsingFFmpeg: Parse metadada with FFMpeg: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg video stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "und"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg audio stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "eng"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg root container metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("compatible_brands", "isommp42")("creation_time", "2020-11-09T00:24:02.000000Z")("major_brand", "mp42")("minor_version", "0"))
Digikam::DMetadata::loadUsingFFmpeg: ------------------------------------------
Digikam::CoreDB::clearMetadataFromImage: Clean up the image information, the file will be scanned again
Digikam::MetaEngine::getDigitizationDateTime: DateTime (Exif digitalized): QDateTime(2020-11-09 00:24:02.000 PST Qt::LocalTime)
Digikam::MetaEngine::getDigitizationDateTime: DateTime (XMP-Exif digitalized): QDateTime(2020-11-09 00:24:02.000 PST Qt::LocalTime)
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::MetaEngine::getXmpTagStringSeq: XMP String Seq ( Xmp.digiKam.TagsList ): ("Friends/Bob", "2020/11 Bob")
Digikam::ItemScanner::scanTags: Pick Label found : 0
Digikam::ItemScanner::scanTags: Assigned Pick Label Tag : 15
Digikam::ItemScanner::scanTags: Color Label found : 0
Digikam::ItemScanner::scanTags: Assigned Color Label Tag : 5
Digikam::ItemScanner::commit: Scanning took 96 ms
Digikam::ItemScanner::~ItemScanner: Finishing took 7 ms
Digikam::DMetadata::loadUsingFFmpeg: Parse metadada with FFMpeg: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::DMetadata::loadUsingFFmpeg: Parse metadada with FFMpeg: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg video stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "und"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg audio stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "eng"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg root container metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("compatible_brands", "isommp42")("creation_time", "2020-11-09T00:24:02.000000Z")("major_brand", "mp42")("minor_version", "0"))
Digikam::DMetadata::loadUsingFFmpeg: ------------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg video stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "und"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg audio stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "eng"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg root container metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("compatible_brands", "isommp42")("creation_time", "2020-11-09T00:24:02.000000Z")("major_brand", "mp42")("minor_version", "0"))
Digikam::DMetadata::loadUsingFFmpeg: ------------------------------------------
Digikam::ThumbnailCreator::createThumbnail: Trying to load video preview with FFmpeg
Digikam::ThumbnailCreator::createThumbnail: Trying to load video preview with FFmpeg
Digikam::ActionThreadBase::setMaximumNumberOfThreads: Using 16 CPU core to run threads
Digikam::ActionThreadBase::run: Action Thread run 1 new jobs
Digikam::ActionThreadBase::slotJobFinished: One job is done
Digikam::ActionThreadBase::cancel: Cancel Main Thread
Digikam::ActionThreadBase::setMaximumNumberOfThreads: Using 16 CPU core to run threads
Digikam::ActionThreadBase::run: Action Thread run 1 new jobs
Digikam::ActionThreadBase::slotJobFinished: One job is done
Digikam::ActionThreadBase::cancel: Cancel Main Thread
Digikam::DBinaryIface::checkDirForPath: Testing "mysql_install_db" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinaryIface::checkDirForPath: Testing "mysqld" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinaryIface::checkDirForPath: Testing "mysql_install_db" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinaryIface::checkDirForPath: Testing "mysqld" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinaryIface::checkDirForPath: Testing "././/bin/mysql_install_db" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinarySearch::slotAreBinariesFound: All Binaries Found : false
Digikam::DBinaryIface::checkDirForPath: Testing "././/bin/mysqld" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinarySearch::slotAreBinariesFound: All Binaries Found : false
Digikam::DBinaryIface::checkDirForPath: Testing "././/sbin/mysql_install_db" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinarySearch::slotAreBinariesFound: All Binaries Found : false
Digikam::DBinaryIface::checkDirForPath: Testing "././/sbin/mysqld" ...
Digikam::adjustedEnvironmentForAppImage: Adjusting environment variables for AppImage bundle
Digikam::DBinarySearch::slotAreBinariesFound: All Binaries Found : false
Digikam::DImg::load: "/tmp/.mount_digiKao24k3T/usr/share/digikam/data/sample-aix.png" : "PNG" file identified
unknown: Opening file "/tmp/.mount_digiKao24k3T/usr/share/digikam/data/sample-aix.png"
unknown: PNG in >=8 bits/color/pixel.
unknown: PNG in PNG_COLOR_TYPE_RGB
The cause must be different. I cannot reproduce it. What happens if you move "11 Bob" to the top "2020"? If it doesn't work, the tags table is probably damaged. Please then post the messages during the tag move. Maik Can it be that 2 xmp files exist with you? A BASENAME.xmp file could also be available from which the tag path is read. The order digiKam searches for xmp files is first BASENAME.xmp and then BASENAME.EXT.xmp. Maik All *xmp files are *.mp4.xmp in the relevant directory, so a duplicate .xmp is not the answer. I unchecked 2020/2020/11 Bob, checked 2020/11 Bob (in the Tags UI), then clicked "apply". The log follows.
Your theory there is some problem with the database makes sense as the .XMP seems fine. I imported many files with x.y keywords. Some of the get parsed as x/y, some as x/x.y, and some as x.y (where '/' is the hierarchy separator in digiKam:TagsList). I was able to clean many of these by manually assigning tags. So, things are usually working, but there are several cases, 2020/11 Bob one of them, where I cannot clean them up. I mean that other very similar .XMP files worked, so that only leaves the theory there is something in the database different in this case.
It seems odd to me that digiKam should be keeping any of this state when I explicitly request a metadata reread. Something is both munged in the database and not being cleaned out. I'm not willing to share the whole database (as there is a lot of confidential information in there), but I can open it and look at some tables if you tell me where to start on that.
For instance, the tags table contains:
1197 22 11 Bob
1199 1191 11 Bob
The pid of 22 is 0. The pids for 1191 (in TagsTree) are:
1191 0
1191 22
and 22 in Tags:
22 0 2020
apparently representing 2020/11 Bob and 2020/2020/11 Bob both, but that doesn't explain why I cannot reassign tags.
Digikam::DMetadata::loadUsingFFmpeg: Parse metadada with FFMpeg: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg video stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "und"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg audio stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "eng"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg root container metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("compatible_brands", "isommp42")("creation_time", "2020-11-09T00:24:02.000000Z")("major_brand", "mp42")("minor_version", "0"))
Digikam::DMetadata::loadUsingFFmpeg: ------------------------------------------
Digikam::MetadataHub::writeTags: Writing tags
Digikam::MetadataHub::writeTags: -------------------------- New Keywords ("Bob", "11 Bob")
Digikam::MetaEngine::setIptcKeywords: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4" ==> New Iptc Keywords: ("11 Bob", "Bob")
Digikam::MetaEngine::save: MetaEngine::metadataWritingMode 3
Digikam::MetaEngine::save: Will write Metadata to file "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::MetaEngine::Private::printExiv2ExceptionError: Cannot save metadata to image using Exiv2 (Error # 11 : "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4: The file contains data of an unknown image type"
Digikam::MetaEngine::save: Will write XMP sidecar for file "PXL_20201108_232847662.mp4"
Digikam::MetaEngine::Private::saveOperations: wroteComment: false
Digikam::MetaEngine::Private::saveOperations: wroteEXIF: true
Digikam::MetaEngine::Private::saveOperations: wroteIPTC: true
Digikam::MetaEngine::Private::saveOperations: wroteXMP: true
Digikam::MetaEngine::save: Metadata for file "PXL_20201108_232847662.mp4" written to XMP sidecar.
Digikam::DMetadata::loadUsingFFmpeg: Parse metadada with FFMpeg: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg video stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "und"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg audio stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "eng"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg root container metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("compatible_brands", "isommp42")("creation_time", "2020-11-09T00:24:02.000000Z")("major_brand", "mp42")("minor_version", "0"))
Digikam::DMetadata::loadUsingFFmpeg: ------------------------------------------
Digikam::CoreDB::clearMetadataFromImage: Clean up the image information, the file will be scanned again
Digikam::MetaEngine::getDigitizationDateTime: DateTime (Exif digitalized): QDateTime(2020-11-09 00:24:02.000 PST Qt::LocalTime)
Digikam::MetaEngine::getDigitizationDateTime: DateTime (XMP-Exif digitalized): QDateTime(2020-11-09 00:24:02.000 PST Qt::LocalTime)
Digikam::ItemMarkerTiler::slotSourceModelReset: ----
Digikam::MetaEngine::getXmpTagStringSeq: XMP String Seq ( Xmp.digiKam.TagsList ): ("2020/11 Bob", "Friends/Bob")
Digikam::ItemScanner::scanTags: Pick Label found : 0
Digikam::ItemScanner::scanTags: Assigned Pick Label Tag : 15
Digikam::ItemScanner::scanTags: Color Label found : 0
Digikam::ItemScanner::scanTags: Assigned Color Label Tag : 5
Digikam::ItemScanner::commit: Scanning took 46 ms
Digikam::ItemScanner::~ItemScanner: Finishing took 7 ms
Digikam::DMetadata::loadUsingFFmpeg: Parse metadada with FFMpeg: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::DMetadata::loadUsingFFmpeg: Parse metadada with FFMpeg: "/home/ervan/Pictures/Personal/2020/11 10 Yosemite/PXL_20201108_232847662.mp4"
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg video stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "und"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg audio stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "eng"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg root container metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("compatible_brands", "isommp42")("creation_time", "2020-11-09T00:24:02.000000Z")("major_brand", "mp42")("minor_version", "0"))
Digikam::DMetadata::loadUsingFFmpeg: ------------------------------------------
Digikam::ThumbnailCreator::createThumbnail: Trying to load video preview with FFmpeg
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg video stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "und"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg audio stream metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("creation_time", "2020-11-09T00:24:02.000000Z")("handler_name", "ISO Media file produced by Google Inc. Created on: 11/08/2020.")("language", "eng"))
Digikam::DMetadata::loadUsingFFmpeg: -----------------------------------------
Digikam::DMetadata::loadUsingFFmpeg: -- FFMpeg root container metadata entries :
Digikam::DMetadata::loadUsingFFmpeg: QMap(("compatible_brands", "isommp42")("creation_time", "2020-11-09T00:24:02.000000Z")("major_brand", "mp42")("minor_version", "0"))
Digikam::DMetadata::loadUsingFFmpeg: ------------------------------------------
Digikam::ThumbnailCreator::createThumbnail: Trying to load video preview with FFmpeg
Digikam::ActionThreadBase::setMaximumNumberOfThreads: Using 16 CPU core to run threads
Digikam::ActionThreadBase::run: Action Thread run 1 new jobs
Digikam::ActionThreadBase::slotJobFinished: One job is done
Digikam::ActionThreadBase::cancel: Cancel Main Thread
Digikam::ActionThreadBase::setMaximumNumberOfThreads: Using 16 CPU core to run threads
Digikam::ActionThreadBase::run: Action Thread run 1 new jobs
Digikam::ActionThreadBase::slotJobFinished: One job is done
Digikam::ActionThreadBase::cancel: Cancel Main Thread
Ok, there is an easy work around: 1) Create tag "temp" 2) Select all 2020/2020/11 Bob pics from the tag manager and assign them to "temp". 3) Delete 2020/2020/11 Bob and 2020/11 Bob tags completely. 4) Rename temp to 2020/11 Bob I'm still happy to help debug if you care. Also, the original parsing of x.y is tags somehow buggy and I can help drill down on that if you care. Thanks for all of the quick replies. I came across a similar problem, while working with a large tag
hierarchy where the same word is used at different levels.
I've been able to reproduce the problem with a clean database and
doing these steps:
1. Use the tag manager to create these tags:
- "2020/11 Bob"
- "2020/2020/11 Bob"
See image tag-hierarchy-1.jpg
2. Create a blank test image, with no metadata. Refresh to view the new image in digikam.
3. Select the image and assign "2020" and "2020/11 Bob" to the test image.
See attachment tag-hierarchy-2.jpg
4. Click Apply to write the metadata (I have digikam configured to write to XMP sidecars).
The XMP file contains:
<digiKam:TagsList>
<rdf:Seq>
<rdf:li>2020</rdf:li>
<rdf:li>2020/11 Bob</rdf:li>
</rdf:Seq>
</digiKam:TagsList>
Which looks correct.
5. Click "More"->"Read Metadata from file to database".
6. Observe that "2020/2020" and "2020/2020/Bob" are now erroneously ticked.
See attachment tag-hierarchy-3.jpg
The fault lies in TagsCache::tagForPath in file
core/libs/database/tags/tagscache.cpp.
This function doesn't properly handle the case of a path with only one level,
and multiple tag paths with the same name.
I've been testing a fix, and a pull request will be sent shortly.
Created attachment 140197 [details]
Creation of test tags
Created attachment 140198 [details]
Test tags assigned to image
Created attachment 140199 [details]
Tags after metadata is re-read
@Ervan digiKam 8.0.0 is out. This entry still valid with this release ? Best regards Gilles Caulier @Ervan Darnell digiKam 8.1.0 pre-release AppImage bundle is now ported to Exiv2 0.28 which come with a huge list of bugfixes : https://github.com/Exiv2/exiv2/issues/2406#issuecomment-1529139799 AppImage file is available here : https://files.kde.org/digikam/ How to use AppImage under Linux : https://docs.digikam.org/en/getting_started/installation.html#digikam-on-linux Thanks in advance for your feedback Gilles Caulier Confirming the bug does not replicate in 8.x. Can be closed. |