Extracting non standard XMP data ?

Started by JFR, December 02, 2013, 12:59:31 PM

Previous topic - Next topic

JFR


Hello,

I have a little problem and couldn't find a solution neither in Exiftool documentation nor in this forum FAQs.

What I wish to do is to extract all possible information, Exif, IPTC, XMP, from an image file to a separate XMP file (sidecar). My first idea was to use the -tagsfromfile option and issue commands such as :
  exiftool -tagsfromfile image.jpg sidecar.xmp

This works really well, I get all Exif data reencoded into XMP specific schemas, tiff:, exif: et al.
As for XMP data, I obviously get correct information for all XMP data in the source image file, when it comes from standard XMP schemas.

When my source image contains some XMP data from private schemas, I get that data into output when the private schemas has been declared in the .Exiftool_config file.
(This is what was expected and it works well.)

When a private schema is unknown, i.e. not declared in .Exiftool_config, nothing is written to output.

Well, I known XMP, I'm aware that knowledge of a schema is required at least to be able to create such metadata. But, due to the XMP/RDF structure, reading even unknown data should be possible, as long as the original syntax is correct (schema namespace, schema URI).

Is there a way, or an option, to tell exiftool « if you find an unknown schema in the XMP section of the image file, please be kind to output data as is » ?
I've tried several options, e.g. :
  exiftool -tagsfromfile image.jpg "-xmp:all" sidecar.xmp
and other, but las, nothing seems to work.

If it's not possible, I'll live with that, but I'm interested to ear if there is a hint to achieve that.
Thanks in advance,
Regards,
Jean-François

Phil Harvey

Hi Jean-François,

To write everything to XMP you need to create user-defined tags for all unknown tags as you mentioned.

But you can write everything to (non-XMP) RDF/XML with the -X option.  This uses ExifTool-specific namespaces instead of standard XMP:

exiftool -X image.jpg > sidecar.xml

I don't know if this helps.  ExifTool will import information from this format XML file.

- 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 ($).

JFR


Hi Phil,

Many thanks for your prompt reply.

Yes, the -X option is great and gives the most complete available data.
The only problem - for me - is that some metadata type information may get lost.
As an example, if I have an image including a XMP private schema, something like :

<swe:mediumwidth>320</swe:mediumwidth>
<swe:mediumheight>240</swe:mediumheight>
<swe:medium>
   <rdf:Alt>
      <rdf:li xml:lang="x-default">Canson Ingres</rdf:li>
   </rdf:Alt>
</swe:medium> 

extracting with the -X option gives

<XMP-swe:Mediumwidth>320</XMP-swe:Mediumwidth>
<XMP-swe:Mediumheight>240</XMP-swe:Mediumheight>
<XMP-swe:Medium>Canson Ingres</XMP-swe:Medium>

and the medium property, as it appears, can be a scalar text and not obviously a language alternative. Thus, without knowledge of the schema, no way to rebuild the original XMP.

Well, I must think about all that a little more. What looked interesting to me, with the -tagsfromfile option, was to benefit of all the great work done in reencoding Exif properties into standard XMP schemas, exif:, tiff:
Maybe I could use that and also a more direct XMP output, exiftool -xmp -b ..., to get all existing properties including unknown ones.

Anyway, thanks again, and also thanks for all the work done in the exiftool planet :)
Regards,
Jean-François