Bug 346637 - Missing support for Media Pro hierarchical keywords [patch]
Summary: Missing support for Media Pro hierarchical keywords [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 4.9.0
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-25 14:13 UTC by Alan Pater
Modified: 2017-08-13 15:44 UTC (History)
3 users (show)

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


Attachments
XMP sidecar created in Media Pro (4.51 KB, application/xmp)
2015-04-25 16:27 UTC, Alan Pater
Details
Test image with embedded Media Pro metadata (14.73 KB, image/jpeg)
2015-04-25 17:02 UTC, Alan Pater
Details
get Media Pro Catalog Sets (1.49 KB, patch)
2015-04-25 18:55 UTC, Alan Pater
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Pater 2015-04-25 14:13:54 UTC
Media Pro uses the same format as Lightroom for hierarchical keywords. digikam already supports reading and writing that format.

Media Pro has changed owners over the years, from iView, to Microsoft, to Phase One.

Reproducible: Always
Comment 1 Alan Pater 2015-04-25 14:15:25 UTC
I adapted the  LR code in dmetadata.cpp and came up with:

// Read: bool DMetadata::getImageTagsPath(QStringList& tagsPath) const

    // Try to get Tags Path list from Media Pro XMP first.
    tagsPath = getXmpTagStringBag("Xmp.mediapro.CatalogSets", false);

    // There is another Media Pro tag for hierarchical subjects.
    if (tagsPath.isEmpty())
    {
        tagsPath = getXmpTagStringSeq("Xmp.expressionmedia.CatalogSets", false);
    }

    if (!tagsPath.isEmpty())
    {
        // Media Pro Catalog Sets use '|' as separator.
        tagsPath = tagsPath.replaceInStrings("|", "/");
        kDebug() << "Tags Path imported from Media Pro : " << tagsPath;
        return true;
    }
    
    
    
// Write: bool DMetadata::setImageTagsPath(const QStringList& tagsPath) const
 
        QStringList MediaProtagsPath = tagsPath;
        MediaProtagsPath             = MediaProtagsPath.replaceInStrings("/", "|");

        if (!setXmpTagStringBag("Xmp.mediapro.CatalogSets", MediaProtagsPath))
        {
            return false;
        }

I have not tested this as I am still unable to build digikam.
Comment 2 caulier.gilles 2015-04-25 16:11:08 UTC
Please provide patch against current source code, even if it do not compile. It's always better than to try to reproduce code as well.

If you have some test images to import/export...

Gilles
Comment 3 Alan Pater 2015-04-25 16:27:34 UTC
Created attachment 92214 [details]
XMP sidecar created in Media Pro
Comment 4 Alan Pater 2015-04-25 17:02:28 UTC
Created attachment 92215 [details]
Test image with embedded Media Pro metadata
Comment 5 Alan Pater 2015-04-25 17:05:43 UTC
Comment on attachment 92215 [details]
Test image with embedded Media Pro metadata

Non-standard properties written by Media Pro:

Xmp.mediapro.Event                           XmpText    15  Media Pro Event
Xmp.mediapro.People                          XmpBag      4  Media Pro People, Alan Pater, Gilles Caulier, Robin Mills
Xmp.mediapro.CatalogSets                     XmpBag      3  0000|1111|2222, aaaa|bbbb|ccc, aaaa|bbbb|cccc|dddd|eeee|fff

Xmp.expressionmedia.Event                    XmpText    15  Media Pro Event
Xmp.expressionmedia.People                   XmpBag      4  Media Pro People, Alan Pater, Gilles Caulier, Robin Mills
Xmp.expressionmedia.CatalogSets              XmpBag      3  0000|1111|2222, aaaa|bbbb|ccc, aaaa|bbbb|cccc|dddd|eeee|fff

Xmp.iptcExt.Event                            LangAlt     1  lang="x-default" Media Pro Event
Xmp.iptcExt.PersonInImage                    XmpBag      4  Media Pro People, Alan Pater, Gilles Caulier, Robin Mills
Comment 6 Alan Pater 2015-04-25 18:55:16 UTC
Created attachment 92217 [details]
get Media Pro Catalog Sets

Untested. Based on the code to get lr hierarchical keywords.
Comment 7 Maik Qualmann 2015-05-04 20:34:30 UTC
Alan,

you use in the patch:

getXmpTagStringSeq ("Xmp.expressionmedia.CatalogSets", false)

I think this is correct:

getXmpTagStringBag ("Xmp.expressionmedia.CatalogSets", false)

Yes?

Maik
Comment 8 Alan Pater 2015-05-04 21:11:14 UTC
Maik yes, you are correct. It should be Bag just like the mediapro example.
Comment 9 Maik Qualmann 2015-05-05 16:38:38 UTC
Git commit c697e630c4483833a27c96bb3969c5574af01045 by Maik Qualmann.
Committed on 05/05/2015 at 16:32.
Pushed by mqualmann into branch 'master'.

apply patch #92217 from Alan Pater to support Media Pro hierarchical keywords
FIXED-IN: 4.10.0

M  +2    -1    NEWS
M  +28   -2    libs/dmetadata/dmetadata.cpp

http://commits.kde.org/digikam/c697e630c4483833a27c96bb3969c5574af01045
Comment 10 caulier.gilles 2015-05-05 21:26:49 UTC
Git commit e22fe7e171b4c3aeb9f56b6536892edf4ffd827b by Gilles Caulier.
Committed on 05/05/2015 at 21:26.
Pushed by cgilles into branch 'frameworks'.

backport commit #c697e630c4483833a27c96bb3969c5574af01045 from git/master to frameworks branch

M  +28   -2    libs/dmetadata/dmetadata.cpp

http://commits.kde.org/digikam/e22fe7e171b4c3aeb9f56b6536892edf4ffd827b