Bug 447503 - Problem reading Excire Foto software tags from JPEG files
Summary: Problem reading Excire Foto software tags from JPEG files
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Xmp (show other bugs)
Version: 7.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-25 10:37 UTC by LarsE
Modified: 2021-12-25 16:47 UTC (History)
2 users (show)

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


Attachments
JPEG file with Xmp.dc.subject and Xmp.excire.hierarchicalSubject element to reproduce this issue (751.86 KB, image/jpeg)
2021-12-25 10:39 UTC, LarsE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LarsE 2021-12-25 10:37:57 UTC
SUMMARY
In my workflow I'm using digiKam to manage my pictures. 
 * After importing the RAW photos in digiKam photos are initially tagged and rated there.
 * The RAW processing and updating of picture-rating is done in darktable.
 * After RAW processing, the JPEGs are exported by darktable to the parent directory of the RAW files including all meta-information.
 * The JPEGs are then read into the Excire Foto software. The tags added in the prior steps are perfectly available in Excire, too. More tags are now added to the already existing set of tags, based on the Excire image recognition features.
 * The JPEGs metadata is updated by Excire storing additional information to the Xmp.dc.subject and the proprietary Xmp.excire.hierarchicalSubject elements. 
 * The files are finally synced with digiKam by refreshing the album, that already holds the RAW files.
 * In digiKam all JPEGs are now visible in the related album. All tags from the Xmp.dc.subject are available in digiKam and assigned to the JPEGs, but the additional tags that were stored by Excire Foto in the Xmp.excire.hierarchicalSubject element are neither available in digiKam tags, nor assigned to the JPEGs. Even though a dedicated setting was applied in digiKam (see below).


STEPS TO REPRODUCE
1. set-up a tag related rule for reading the special/proprietary excire tags: digiKam Options => meta-data => advanced. There I choose “Tags” from the Dropdown and have “Read Options” chosen. The check-box “Unify read and write” is deactivated. I define a new rule for Xmp.excire.hierarchicalSubject, separator ‘|’ and XMPBAGS as special option. Finally I moved it at the 2nd position after the Xmp.dc.subject rule, that I put to the first position.
2. Import the attached JPEG into digiKam or refresh the album that already holds this JPEG file


OBSERVED RESULT
1. see, that all tags from Xmp.dc.subject are perfectly available as tags in digiKam and are assigned to the JPEG metadata inside digiKam
2. see, that no tags from the proprietary Xmp.excire.hierarchicalSubject are imported


EXPECTED RESULT
Also the proprietary Xmp.excire.hierarchicalSubject tags shall be imported into digiKam, be available there in the tag list and be assigned to the JPEGs

SOFTWARE/OS VERSIONS
Windows: 10 Pro x64 20H2
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2 (built against 5.15.2)

ADDITIONAL INFORMATION
see also https://discuss.pixls.us/t/take-over-comments-from-jpeg-into-tags-of-digikam/28356
Comment 1 LarsE 2021-12-25 10:39:34 UTC
Created attachment 144854 [details]
JPEG file with Xmp.dc.subject and Xmp.excire.hierarchicalSubject element to reproduce this issue
Comment 2 Maik Qualmann 2021-12-25 11:10:13 UTC
Your problem is understanding how digiKam reads tags or other metadata. You expect all metadata tags to be read. This is not the case, however, if digiKam finds tags, the list is no longer processed. When I position the new entry with Xmp.excire.hierarchicalSubject at the top, the metadata is read. Remember, we cannot read all tags, this would completely break the workflow for other users. Many proprietary programs only write one metadata tag and leave the other possible tags unused or old.

Maik
Comment 3 LarsE 2021-12-25 11:21:25 UTC
Hi Maik,

thanks for your quick reply and your explanation which I really appreciate! Great to hear that the import is possible, I didn't try to change the order, since it was not clear to me, that as soon as one active definition matches, all other active definitions will be skipped. That's indeed a pity, since I therefore need to refresh once, switch the sequence and refresh once again. 

What do you think, would it be possible to allow (as an option, not per default, to ensure compatibility for existing workflows as you explained) that all activated items are taken into account when reading the metadata? Since the user has the possibility to switch off unneeded items, I would assume that such change might be safe and a big improvement (OK, at least for my workflow ;-).

Best wishes, have a pleasant x-mas time and a happy new year.

Cheers,
Lars.
Comment 4 LarsE 2021-12-25 12:47:13 UTC
(In reply to LarsE from comment #3)
> Great to hear that the import is possible, I didn't try to change the order,
> since it was not clear to me, that as soon as one active definition matches,
> all other active definitions will be skipped. That's indeed a pity, since I
> therefore need to refresh once, switch the sequence and refresh once again. 

I just checked as you suggested and found, that the tags that were already assigned before (Xmp.dc.subject) are completely replaced by the Excire tags (Xmp.excire.hierarchicalSubject) during the second refresh. I thought they would be added... Well I think my suggestion may be quite beneficial in such situations ;-)
Comment 5 Maik Qualmann 2021-12-25 14:36:30 UTC
Git commit fce51f439ef2a2d4c577e0ace4d79857fd40ea51 by Maik Qualmann.
Committed on 25/12/2021 at 14:35.
Pushed by mqualmann into branch 'master'.

add option to read entire list for tags
FIXED-IN: 7.5.0

M  +1    -1    NEWS
M  +38   -18   core/libs/metadataengine/dmetadata/dmetadata_tags.cpp
M  +19   -4    core/libs/metadataengine/dmetadata/dmetadatasettingscontainer.cpp
M  +3    -0    core/libs/metadataengine/dmetadata/dmetadatasettingscontainer.h
M  +25   -7    core/utilities/setup/metadata/advancedmetadatatab.cpp
M  +1    -0    core/utilities/setup/metadata/advancedmetadatatab.h

https://invent.kde.org/graphics/digikam/commit/fce51f439ef2a2d4c577e0ace4d79857fd40ea51
Comment 6 Maik Qualmann 2021-12-25 14:40:17 UTC
(In reply to LarsE from comment #4)
> I just checked as you suggested and found, that the tags that were already
> assigned before (Xmp.dc.subject) are completely replaced by the Excire tags
> (Xmp.excire.hierarchicalSubject) during the second refresh. I thought they
> would be added... Well I think my suggestion may be quite beneficial in such
> situations ;-)

If tags have disappeared after the 2nd run, then you have activated the option to clean up the database by reading metadata.
With the new option to read all tags from the list, this no longer matters. 

Maik
Comment 7 LarsE 2021-12-25 14:43:49 UTC
(In reply to Maik Qualmann from comment #6)
> If tags have disappeared after the 2nd run, then you have activated the
> option to clean up the database by reading metadata.
I was looking for such option, but didn't find it... Thanks for your hint!

> With the new option to read all tags from the list, this no longer matters. 
OMG, kudos & thanks a million for implementing the suggestion so quickly!

Lars.
Comment 8 Maik Qualmann 2021-12-25 16:47:34 UTC
Git commit 81418a0c19ab7e775380296e0b14c9f3d88a3d1e by Maik Qualmann.
Committed on 25/12/2021 at 16:46.
Pushed by mqualmann into branch 'master'.

add register extra namespace "excire"

M  +1    -0    core/libs/metadataengine/engine/metaengine.cpp

https://invent.kde.org/graphics/digikam/commit/81418a0c19ab7e775380296e0b14c9f3d88a3d1e