-xmp Structured tag display error if flattened

Started by bobwolfeumich, November 27, 2011, 10:12:02 AM

Previous topic - Next topic

bobwolfeumich

Multiple xmp face rectangle tags are displayed OK with -struct but look wrong if flat.

Tested with the attached 1940.jpg (has several family members named).
The output is OK with
exiftool -struct -xmp:all 1940.jpg
The output looks wrong with
exiftool  -xmp:all 1940.jpg

The erroneous display (with repeated names and the (100%) added to some names) appears to mimic the problem that Picasa randomly introduces into face tags, so I suspect that Picasa is somehow using the exiftool flattened output to manage its face rectangle tags. The tags in the file were created from my Picasa data using  Andreas Vogel's (wonderful) AvPicFaceXmpTagger program.

I am a newbie, and apologize if this is all due to my error.

bobwolfeumich

Using ExifTool 8.71 on Windows 7.

Output:
c:\2Wolfe\DocsSoftware\Photo>exiftool  -xmp:all 1940.jpg
XMP Toolkit                     : Image::ExifTool 8.16
Region Person Display Name      : Douglas Arthur Wolfe, Douglas Arthur Wolfe, Do
uglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas Arthur W
olfe, Douglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas
Arthur Wolfe, Douglas Arthur Wolfe, Mabel Rivir Good (100%), Douglas Arthur Wolf
e, Ramon Wolfe, Irby J Good
Region Rectangle                : 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0
.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.
1096819, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06
186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.470
5119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434
577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.10968
19, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2577249, 0.3490501, 0.0808880
6, 0.1462272, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.5614557, 0.4858473,
0.07058823, 0.1261769, 0.4789807, 0.3490501, 0.08168158, 0.1450523
Subject                         : Mabel Rivir Good, Douglas Arthur Wolfe, Ramon
Wolfe, Irby J Good

c:\2Wolfe\DocsSoftware\Photo>exiftool  -ver
8.71

c:\2Wolfe\DocsSoftware\Photo>exiftool  -xmp:all 1940.jpg
XMP Toolkit                     : Image::ExifTool 8.16
Region Person Display Name      : Douglas Arthur Wolfe, Douglas Arthur Wolfe, Do
uglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas Arthur W
olfe, Douglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas Arthur Wolfe, Douglas
Arthur Wolfe, Douglas Arthur Wolfe, Mabel Rivir Good (100%), Douglas Arthur Wolf
e, Ramon Wolfe, Irby J Good
Region Rectangle                : 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0
.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.
1096819, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06
186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.470
5119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2434
577, 0.4705119, 0.06186007, 0.1096819, 0.2434577, 0.4705119, 0.06186007, 0.10968
19, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.2577249, 0.3490501, 0.0808880
6, 0.1462272, 0.2434577, 0.4705119, 0.06186007, 0.1096819, 0.5614557, 0.4858473,
0.07058823, 0.1261769, 0.4789807, 0.3490501, 0.08168158, 0.1450523
Subject                         : Mabel Rivir Good, Douglas Arthur Wolfe, Ramon
Wolfe, Irby J Good

Phil Harvey

This looks correct to me.  The flattened output is difficult to interpret for lists of structures like this, but it would make more sense if you use a different separator, i.e.)

> exiftool 1940.jpg -xmp:all -sep "; "
XMP Toolkit                     : Image::ExifTool 8.16
Region Person Display Name      : Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Douglas Arthur Wolfe; Mabel Rivir Good (100%); Douglas Arthur Wolfe; Ramon Wolfe; Irby J Good
Region Rectangle                : 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.2577249, 0.3490501, 0.08088806, 0.1462272; 0.2434577, 0.4705119, 0.06186007, 0.1096819; 0.5614557, 0.4858473, 0.07058823, 0.1261769; 0.4789807, 0.3490501, 0.08168158, 0.1450523
Subject                         : Mabel Rivir Good; Douglas Arthur Wolfe; Ramon Wolfe; Irby J Good
Create Date                     : 1940:02:27 11:54:08.262


I can't comment on why the file contains duplicate names or the "(100%)" after one name, but exiftool is just reporting the information from the file.  Here is the raw XMP:

> exiftool 1940.jpg -xmp -b
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 8.16'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about=''
  xmlns:MP='http://ns.microsoft.com/photo/1.2/'
  xmlns:MPRI='http://ns.microsoft.com/photo/1.2/t/RegionInfo#'
  xmlns:MPReg='http://ns.microsoft.com/photo/1.2/t/Region#'>
  <MP:RegionInfo rdf:parseType='Resource'>
   <MPRI:Regions>
    <rdf:Bag>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Mabel Rivir Good (100%)</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2577249, 0.3490501, 0.08088806, 0.1462272</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Douglas Arthur Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.2434577, 0.4705119, 0.06186007, 0.1096819</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Ramon Wolfe</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.5614557, 0.4858473, 0.07058823, 0.1261769</MPReg:Rectangle>
     </rdf:li>
     <rdf:li rdf:parseType='Resource'>
      <MPReg:PersonDisplayName>Irby J Good</MPReg:PersonDisplayName>
      <MPReg:Rectangle>0.4789807, 0.3490501, 0.08168158, 0.1450523</MPReg:Rectangle>
     </rdf:li>
    </rdf:Bag>
   </MPRI:Regions>
  </MP:RegionInfo>
</rdf:Description>

<rdf:Description rdf:about=''
  xmlns:dc='http://purl.org/dc/elements/1.1/'>
  <dc:subject>
   <rdf:Bag>
    <rdf:li>Mabel Rivir Good</rdf:li>
    <rdf:li>Douglas Arthur Wolfe</rdf:li>
    <rdf:li>Ramon Wolfe</rdf:li>
    <rdf:li>Irby J Good</rdf:li>
   </rdf:Bag>
  </dc:subject>
</rdf:Description>

<rdf:Description rdf:about=''
  xmlns:xmp='http://ns.adobe.com/xap/1.0/'>
  <xmp:CreateDate>1940-02-27T11:54:08.262</xmp:CreateDate>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>


In this case, the raw XMP is somewhat more readable than the normal ExifTool output.  But for readability, perhaps the JSON output is best in cases like this:

> exiftool 1940.jpg -struct -xmp:all -json
[{
  "SourceFile": "/Users/phil/Downloads/1940.jpg",
  "XMPToolkit": "Image::ExifTool 8.16",
  "RegionInfoMP": {
    "Regions": [{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Mabel Rivir Good (100%)",
      "Rectangle": "0.2577249, 0.3490501, 0.08088806, 0.1462272"
    },{
      "PersonDisplayName": "Douglas Arthur Wolfe",
      "Rectangle": "0.2434577, 0.4705119, 0.06186007, 0.1096819"
    },{
      "PersonDisplayName": "Ramon Wolfe",
      "Rectangle": "0.5614557, 0.4858473, 0.07058823, 0.1261769"
    },{
      "PersonDisplayName": "Irby J Good",
      "Rectangle": "0.4789807, 0.3490501, 0.08168158, 0.1450523"
    }]
  },
  "Subject": ["Mabel Rivir Good","Douglas Arthur Wolfe","Ramon Wolfe","Irby J Good"]
}]


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