Hi,
I have created a config file for custom tags for XMP, where one of the fields is suppose to be a JSON input.
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::Main' => {
MyNS => { # <-- must be the same as the NAMESPACE prefix
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::MyNS',
# (see the definition of this table below)
},
},
},
);
%Image::ExifTool::UserDefined::MyNS = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-MyNS', 2 => 'Image' },
NAMESPACE => { 'MyNS' => 'http://ns.myname.com/MyNS/1.0/' },
WRITABLE => 'string', # (default to string-type tags)
MyStruct => {
Struct => {
MyId => {Writable => 'integer'},
JSON => {},
Created => {Writable => 'date'}
},
List => 'Seq',
Name => 'MyData',
},
);
1; #end
But when i add a new tag
exiftool -config .ExifTool_config -MyDataMyId+=1 -MyDataCreated+=2020:05:07 -MyDataJSON+="{\"a\":1}" img.jpg
but the problem is i see the XMP as <MyNS:JSON>{"a":1}</MyNS:JSON>
Is there a way to make sure the json data is not encoded?
The short answer is "no".
Read here for the reason (https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents).
- Phil