XML output: namespace data differs between ExifTool and Photoshop

Started by stecca, August 24, 2018, 11:22:49 AM

Previous topic - Next topic

stecca

I'm working with a file that contains custom groups and tags. In creating a custom config to read and write to these I ran into an issue where writing wasn't possible. The issue turned out to be related to the namespace setting for the custom groups. I was surprised to find out that what showed in ExifTool's xml output was different than what I saw in Photoshop's raw data area:

ExifTool:
xmlns:XMP-ns_60='http://ns.exiftool.ca/XMP/XMP-ns_60/1.0/'

Photoshop:
xmlns:ns_60="Imaging_Request"

What showed in Photoshop was what I actually needed to use when defining the namespace for the group.

Here's the full sections of each output:

ExifTool:

xmlns:et='http://ns.exiftool.ca/1.0/' et:toolkit='Image::ExifTool 10.10'
xmlns:ExifTool='http://ns.exiftool.ca/ExifTool/1.0/'
xmlns:System='http://ns.exiftool.ca/File/System/1.0/'
xmlns:File='http://ns.exiftool.ca/File/1.0/'
xmlns:IFD0='http://ns.exiftool.ca/EXIF/IFD0/1.0/'
xmlns:XMP-x='http://ns.exiftool.ca/XMP/XMP-x/1.0/'
xmlns:XMP-rdf='http://ns.exiftool.ca/XMP/XMP-rdf/1.0/'
xmlns:XMP-tiff='http://ns.exiftool.ca/XMP/XMP-tiff/1.0/'
xmlns:XMP-exif='http://ns.exiftool.ca/XMP/XMP-exif/1.0/'
xmlns:XMP-xmpMM='http://ns.exiftool.ca/XMP/XMP-xmpMM/1.0/'
xmlns:XMP-xmp='http://ns.exiftool.ca/XMP/XMP-xmp/1.0/'
xmlns:XMP-dc='http://ns.exiftool.ca/XMP/XMP-dc/1.0/'
xmlns:XMP-photoshop='http://ns.exiftool.ca/XMP/XMP-photoshop/1.0/'
xmlns:XMP-xmpRights='http://ns.exiftool.ca/XMP/XMP-xmpRights/1.0/'
xmlns:XMP-ns_60='http://ns.exiftool.ca/XMP/XMP-ns_60/1.0/'
xmlns:XMP-mb='http://ns.exiftool.ca/XMP/XMP-mb/1.0/'
xmlns:XMP-ns_95='http://ns.exiftool.ca/XMP/XMP-ns_95/1.0/'
xmlns:XMP-def='http://ns.exiftool.ca/XMP/XMP-def/1.0/'
xmlns:IPTC='http://ns.exiftool.ca/IPTC/IPTC/1.0/'
xmlns:IPTC2='http://ns.exiftool.ca/IPTC/IPTC2/1.0/'
xmlns:Photoshop='http://ns.exiftool.ca/Photoshop/Photoshop/1.0/'
xmlns:ExifIFD='http://ns.exiftool.ca/EXIF/ExifIFD/1.0/'
xmlns:ICC-header='http://ns.exiftool.ca/ICC_Profile/ICC-header/1.0/'
xmlns:ICC_Profile='http://ns.exiftool.ca/ICC_Profile/ICC_Profile/1.0/'
xmlns:Composite='http://ns.exiftool.ca/Composite/1.0/'>


Photoshop:

xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/"
xmlns:ns_60="Imaging_Request"
xmlns:mb="http://brightech.com/ns/mb"
xmlns:ns_95="Photo-Dept"
xmlns:def="http://mediabeacon.com/ns/default/1.0/"
xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
xmlns:exif="http://ns.adobe.com/exif/1.0/">



The command I used for output: exiftool <file> -X

Am I missing something in my ExifTool command that would have resulted in an output like I found in Photoshop?

Appreciate any help.

Phil Harvey

Photoshop understands only XMP, and you are trying to feed it the ExifTool XML output which is not XMP.  I am surprised you get anything useful at all.

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

stecca

I did not feed the output from ExifTool into Photoshop. I used the same tiff file in both applications to get the output. I used the raw data section of 'file info' from Photoshop, which provided me with accurate namespace information. I used the command mentioned in the original post in ExifTool. The namespace outputs are clearly different. The output from ExifTool replaced every namespace value with ExifTool urls.

I'm trying to understand why the namespace portion of the output from ExifTool was incorrect.

Phil Harvey

Ah, I see.

The namespaces aren't wrong, the -X output is an output of ExifTool tags, and the namespaces represent the ExifTool groups.

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

stecca

The namespace URLs output by ExifTool are incorrect. If I use the ExifTool output to set up the ns_60 group in my config I am not able to update the group's fields if data already exists. The namespace needs to be set up as NAMESPACE     => { 'ns_60' => 'Imaging_Request' }, to fully work.

I'm not sure how I would have gotten the correct info from ExifTool. Is there a way?

Phil Harvey

Quote from: stecca on August 27, 2018, 12:21:46 PM
The namespace URLs output by ExifTool are incorrect.

Again, No.  The namespaces used by ExifTool are correct.  The -X output is ExifTool-specific tag information.  Not standard XMP as you are assuming.  Try outputting as XMP instead.  To output the raw XMP, do this:

exiftool -xmp -b FILE

Or it is possible to convert other metadata to XMP as well.

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

stecca