I'm practicing creating tag definitions for some random and obscure tags I've come across and I'm a bit stumped on this. The XMP shows that there is a dot in the tag name. The closest thing I could find in the forums is this thread, "Issue with adding Custom tags, which contains special characters" (https://exiftool.org/forum/index.php?msg=30502), but the quotes don't seem to help.
Here's the XMP. I reduced it to two structured entries, as the actual XMP was extensive. The problem tag is the "FontSense_1.2_Checksum", which exiftool outputs as SlugFontSense_12_Checksum
<?xpacket begin='�' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 13.31'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about=''
xmlns:ExtensisFontSense='http://www.extensis.com/meta/FontSense/'>
<ExtensisFontSense:slug>
<rdf:Bag>
<rdf:li rdf:parseType='Resource'>
<ExtensisFontSense:Checksum>2145677565</ExtensisFontSense:Checksum>
<ExtensisFontSense:Family>Euclid Circular A</ExtensisFontSense:Family>
<ExtensisFontSense:FontKind>OpenType - PS</ExtensisFontSense:FontKind>
<ExtensisFontSense:FontSense_1.2_Checksum>2145677565</ExtensisFontSense:FontSense_1.2_Checksum>
<ExtensisFontSense:Foundry>--</ExtensisFontSense:Foundry>
<ExtensisFontSense:OutlineFileSize>0</ExtensisFontSense:OutlineFileSize>
<ExtensisFontSense:PostScriptName>EuclidCircularA-Italic</ExtensisFontSense:PostScriptName>
<ExtensisFontSense:Version>3.001</ExtensisFontSense:Version>
</rdf:li>
<rdf:li rdf:parseType='Resource'>
<ExtensisFontSense:Checksum>2143206395</ExtensisFontSense:Checksum>
<ExtensisFontSense:Family>Euclid Circular A</ExtensisFontSense:Family>
<ExtensisFontSense:FontKind>OpenType - PS</ExtensisFontSense:FontKind>
<ExtensisFontSense:FontSense_1.2_Checksum>2143206395</ExtensisFontSense:FontSense_1.2_Checksum>
<ExtensisFontSense:Foundry>--</ExtensisFontSense:Foundry>
<ExtensisFontSense:OutlineFileSize>0</ExtensisFontSense:OutlineFileSize>
<ExtensisFontSense:PostScriptName>EuclidCircularA-Regular</ExtensisFontSense:PostScriptName>
<ExtensisFontSense:Version>3.001</ExtensisFontSense:Version>
</rdf:li>
</rdf:Bag>
</ExtensisFontSense:slug>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>
Here's my config file
# The %Image::ExifTool::UserDefined hash defines new tags to be added
# to existing tables.
%Image::ExifTool::UserDefined = (
# new XMP namespaces (eg. xxx) must be added to the Main XMP table:
'Image::ExifTool::XMP::Main' => {
# namespace definition for examples 8 to 11
ExtensisFontSense => { # <-- must be the same as the NAMESPACE prefix
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::ExtensisFontSense',
# (see the definition of this table below)
},
},
},
),
# This is a basic example of the definition for a new XMP namespace.
# This table is referenced through a SubDirectory tag definition
# in the %Image::ExifTool::UserDefined definition above.
# The namespace prefix for these tags is 'xxx', which corresponds to
# an ExifTool family 1 group name of 'XMP-xxx'.
%Image::ExifTool::UserDefined::ExtensisFontSense = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-ExtensisFontSense', 2 => 'Image' },
NAMESPACE => { 'ExtensisFontSense' => 'http://www.extensis.com/meta/FontSense/' },
WRITABLE => 'string', # (default to string-type tags)
# Example 11. XMP-xxx:NewXMPxxxStruct (a structured tag)
# - example structured XMP tag
Slug => {
# the "Struct" entry defines the structure fields
List => 'Bag',
Struct => {
# optional structure name (used for warning messages only)
STRUCT_NAME => 'ExtensisFontSenseStruct',
# structure field definitions (very similar to tag definitions)
Checksum => { },
Family => { },
FontKind => { },
'FontSense_1.2_Checksum' => { },
Foundry => { },
OutlineFileSize => { },
PostScriptName => { },
Version => { },
},
},
);
If I remove the "FontSense_1.2_Checksum" and write the Slug as structured data, then the resulting XMP matches the original. But otherwise I get this warning and the data is truncated at that spot
Warning: Invalid structure field at 'FontSense_1.2_Checksum=2145...'
The command I was using
exiftool -config ExtensisFontSense.config -P -overwrite_original -slug="[{Checksum=2145677565,Family=Euclid Circular A,FontKind=OpenType - PS,FontSense_1.2_Checksum=2145677565,Foundry=--,OutlineFileSize=0,PostScriptName=EuclidCircularA-Italic,Version=3.001},{Checksum=2143206395,Family=Euclid Circular A,FontKind=OpenType - PS,FontSense_1.2_Checksum=2143206395,Foundry=--,OutlineFileSize=0,PostScriptName=EuclidCircularA-Regular,Version=3.001}]" y:\!temp\Test4.jpg
Where might my error be?
ExifTool is being to strict about the characters allowed in the name of a structure element. I'll patch 13.32 to allow a dot in the name.
Thanks for pointing out this issue.
- Phil