Skip to content

Remove XMP array and struct parent properties #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2018

Conversation

nagix
Copy link
Collaborator

@nagix nagix commented Mar 15, 2018

Problem

XmpDirectory.getXmpProperties returns a map of XMP properties, but it includes array and struct parent properties which don't have an actual value. I suggest that it is preferable to exclude them from the map.

Example:

...
"Iptc4xmpCore:CountryCode": "DE"
"Iptc4xmpCore:Location": "Fotostudio HS"
"Iptc4xmpCore:CreatorContactInfo": ""           <-- Struct parent node
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCity": "Mainz"
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCtry": "Deutschland"
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrExtadr": "Konrad-Adenauer-Str. 33"
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrPcode": "55129"
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrRegion": "Rheinland-Pfalz"
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiEmailWork": "pb@meine-ansichten.de"
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiTelWork": "06136/958638"
"Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiUrlWork": "http://www.meine-ansichten.de"
...
"dc:format": "image/tiff"
"dc:creator": ""                                <-- Array parent node
"dc:creator[1]": "Peter Bemmann"
"dc:rights": ""                                 <-- Array parent node
"dc:rights[1]": "© Peter Bemmann"
"dc:rights[1]/xml:lang": "x-default"
"dc:description": ""                            <-- Array parent node 
"dc:description[1]": "mit blauem Kleid"
"dc:description[1]/xml:lang": "x-default"
...

Solution

Pass an IteratorOptions object when getting XMPIterator objects to limit the type of properties only to leaf nodes in a XMP tree.

@drewnoakes drewnoakes merged commit f3157c8 into drewnoakes:master Mar 19, 2018
@drewnoakes
Copy link
Owner

Great idea. Thanks again.

@nagix nagix deleted the issue-326 branch March 19, 2018 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants