Duplicate tags created... user error or ?

Started by johnbishopimages, August 14, 2012, 07:33:10 PM

Previous topic - Next topic

johnbishopimages

Hi Phil,

Just over a year ago I released a Custom XMP FileInfo panel package for Adobe CS4/5 (and now 6) product suite that added support for the Creative Commons tagset. At that time I had yet to find your tool or any other references to make decisions on regarding the xmpType declarations for the Creative Commons tagset. As a result I created a situation that now is causing me some grief.

In my eagerness to ensure multilanguage support, I mistakenly declared the XMP-cc:attributionName tag as xmpType="langalt". This results in the tag being written as:

<cc:attributionName>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>john bishop images</rdf:li>
   </rdf:Alt>
</cc:attributionName>


I am now in the final testing stages of implementing similar support for Adobe Photoshop Lightroom and in my research I discovered ExifTool (which I hope to use to add these tags to exported files in a custom PostProcess Export action). And this is when I stumbled onto my compatibility problem! ExifTool 8.96 writes the same tag this way:

<cc:attributionName>test</cc:attributionName>

If I use ExifTool to add this tag to an image file that already contains the "langalt" version of the tag, the results are:

<cc:attributionName>test</cc:attributionName>
<cc:attributionName>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>john bishop images</rdf:li>
   </rdf:Alt>
</cc:attributionName>


When I realized the problem I began an in-depth search to see how this might affect other programs and other than my own plugin, either tag definition seems to get displayed correctly, most notable in the Adobe CS products or in any utility based on ExifTool. I have updated my XMP panel to reflect the proper xmpType and am now in final testing.

What I now need is a way forward that will minimize the impact on my existing user base and believe I have a solution but it is one that would require an update to ExifTool and how it handles "duplicate" tags.

My question is this... can ExifTool be modified to remove the existing <cc:attributionName> tag regardless in the xmpType before adding the replacement tag? In this way, over time, the erroneous tags would get corrected. Would such processing logic cause problems in other areas?

I have had over 600 downloads of the Custom XMP FileInfo panel and some of my users include NASA and the state government in Victoria, Australia so I am hoping you will agree to my solution or perhaps offer one that I am not aware of!

Please let me know what you think or if you have any suggestions.

Thanks for your time...

John
;-j


Visit my website at http://johnbishopimages.com, find me on Facebook at http://facebook.com/johnbishopimages or follow me on Twitter http://twitter.com/johnbishopbc

Phil Harvey

Hi John,

ExifTool already fixes a number of other XMP formatting problems like this written by other software (Microsoft is the biggest offender, but surprisingly Adobe itself isn't immune to these bugs either).

I'll have to look into this, but it may be possible to add this to the list of problems that is fixed by ExifTool.  If I did this, writing the AttributionName property to an incorrectly-formatted XMP would give this result:

> exiftool a.xmp -attributionname=test
Warning: [minor] Fixed incorrect list type for XMP-cc:AttributionName - a.xmp
    1 image files updated


Writing any other XMP tag would not generate the warning, and would not fix the formatting problem.

Would this solution work for you?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

johnbishopimages

#2
Gee --- glad to see I keep such good company!  :o

This will work as long as there is only one correctly formatted XMP-cc:AttributionName tag in the output file.

To be clear, and to make sure I understand what you are proposing...

> exiftool -attributionname=test thisfile.jpg

would remove the offending langalt tag and replace it with a text tag resulting in only one XMP-cc:AttributionName tag in the file.
And only supplying the -attributionName tag would generate the fix. Specifying any other tag wouldn't (and probably shouldn't).

Would this work if there were other tags specified in the same command line? For example ...

> exiftool -XMP-cc:attributionURL=http://pickme.com -XMP-cc:attributionName=test -XMP-cc:morePermissions=http://permissions.com thisfile.jpg

or would this have to be on a command line by itself? And I am assuming that using -stay_open -@ cmds.txt would also work here - correct?

If so, yes, this is what I'm looking for.

Note: I tried to attach a sample.jpg file that contained the bad langalt tag for your testing but it failed the forums security checks (it's only 45k).
Would you find this helpful? If so, how could I get it to you?

;-j




Update: I just noticed that the Creative Commons has defined a new tag - "useGuidelines" (see http://creativecommons.org/ns)

The RDF schema for this tag is ...
  <rdf:Property rdf:about="http://creativecommons.org/ns#useGuidelines">
    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
    <rdfs:domain rdf:resource="http://creativecommons.org/ns#Work"/>
  </rdf:Property>


Would you be able to add this to ExifTool?

;-j
Visit my website at http://johnbishopimages.com, find me on Facebook at http://facebook.com/johnbishopimages or follow me on Twitter http://twitter.com/johnbishopbc

Phil Harvey

#3
Yes to all of your questions.  The forum is definitely picky about attachments, so I usually suggest email, but it isn't necessary in this case because you posted the relevant XMP already.

I'll look into the new CC tags, thanks for pointing me to this.

- Phil

Edit: I've looked into the CC namespace documentation, and frankly I can't make heads or tails of it.  Their XMP page still only defines 4 tags.  Presumably they just haven't got around to adding the others, but the specification is totally lacking in clarity so I don't know what should be added.  Similar to your confusion about whether cc:attributionName should be lang-alt or not, there are other new properties such as cc:permits which logically must be a list-type property of some sort (presumably a bag of closed choice), but the documentation doesn't provide this information, and as a result I can't implement it.  A machine-readable "schema.rdf" file is available, but it doesn't help much.  For example, it seems to list some specific Permissions which would apply to cc:permits ("Sharing", "DerivativeWorks", "Reproduction" and "Distribution"), but it doesn't specify the list type or whether it is an open or closed choice.

It would help if you could produce a sample XMP with the new properties written in the "offical" format.  It looks to me as if these are the new properties not yet known to ExifTool:

    legalcode
    jurisdiction
    useGuidelines
    deprecatedOn
    permits
    requires
    prohibits
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

I've spent some more time studying the available CC documentation and searching for examples.

It looks to me as if only "permits", "requires" and "prohibits" support multiple values, and that these properties can take on only specific values.  So it makes sense to define these as "closed choice of Bag" properties in XMP.

The others don't look like list types, but all of them store resources except for "deprecatedOn" which is a date format.

So I will go ahead and add these to ExifTool like this.

It is a real shame that the creative commons don't provide a proper XMP specification for their metadata.  They have fallen into the trap of thinking it is sufficient to give an RDF/XML specification, but this is not the case.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

johnbishopimages

I am most grateful for you time and consideration. And I'm sure my users will be too!

When it comes time to publish my Lightroom plugin, my intention was to charge perhaps around $20.00 or so to register the plugin (which would run in a limited mode otherwise), contributing 10% of the sales back to the Creative Commons. If things go well, I would hope to be able to share some of that with you in terms of a donation. I most certainly will make reference to you and your work on my website and blog.

Thanks again!

;-j
Visit my website at http://johnbishopimages.com, find me on Facebook at http://facebook.com/johnbishopimages or follow me on Twitter http://twitter.com/johnbishopbc