ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: snahl on February 18, 2013, 04:10:33 PM

Title: writing XMP-File: Is there an option to influence the output format?
Post by: snahl on February 18, 2013, 04:10:33 PM
Hello Phil,

Sometimes I need to extract and compare XMP-sidecar files. Depending on the application the outputs vary.
For example Lightroom creates kind of a short version:

<rdf:Description rdf:about=""
  xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
  xmlns:xmp="http://ns.adobe.com/xap/1.0/"
  tiff:Make="NIKON CORPORATION"
  xmp:Label="Select"
  xmp:Rating="1">
</rdf:Description>


whereas Exiftool produces the same in a longer version:
<rdf:Description rdf:about=''
  xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
  <tiff:Make>NIKON CORPORATION</tiff:Make>
</rdf:Description>

<rdf:Description rdf:about=''
  xmlns:xmp='http://ns.adobe.com/xap/1.0/'>
  <xmp:Label>Select</xmp:Label>
  <xmp:Rating>1</xmp:Rating>
</rdf:Description>


I wonder if there is an option to change the output format to the short version to make comparisons much less cumbersome.
Do you happen to know about a software-tool that is able to compare XMP-sidecar files based on content in contrast to textual comparison. Any idea?
Title: Re: writing XMP-File: Is there an option to influence the output format?
Post by: Phil Harvey on February 18, 2013, 08:30:59 PM
What I do is this to compare the metadata of any 2 files:

exiftool -a -u -G1 FILE1 | sort > t1
exiftool -a -u -G1 FILE2 | sort > t2
diff t1 t2


alternatively, if you really want to compare the raw XMP, you can use ExifTool to touch both files, then compare the resulting files:

exiftool -tagsfromfile @ -xmptoolkit a.xmp
exiftool -tagsfromfile @ -xmptoolkit b.xmp
diff a.xmp b.xmp


- Phil
Title: Re: writing XMP-File: Is there an option to influence the output format?
Post by: snahl on February 18, 2013, 09:51:49 PM
Thanks for replying.

Any more specifics for that 'diff' application?
diff a.xmp b.xmp

There are many apps comparing line-by-line - no problemo.
What I am looking for is an application that compares XMP-(XML) files based on their content.

The goal is to find a way to keep xmp-metadata synched between Lightroom and Nikon View NX2 (and thus Nikon Capture NX2).
Reaching this goal would make my current workflow a whole lot easier.

Greetings, Hans.

PS: The greates Ski-Aces ever:
Tony Seiler (A) - Jean-Claude Killy (F) - Ted Ligety (USA)
Congrats
Title: Re: writing XMP-File: Is there an option to influence the output format?
Post by: Phil Harvey on February 19, 2013, 07:36:07 AM
The 'diff' utility compares line-by-line.  Both solutions I gave arrange the metadata so a line-by-line comparison is valid.  So both techniques effectively compare the content.  I don't know what else you want.

- Phil