|
Here is the current state of things. I know I run the risk of overwhelming
people with the large number of available formatting options, but
just skip to the comments at the bottom of this post if you aren't
interested in these details:
exiftool a.jpg -keywords -X
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47'>
<file name='a.jpg'>
<tag name='Keywords'>a</tag>
<tag name='Keywords'>b</tag>
</file>
</metadata>
with group names in two different styles:
exiftool a.jpg -keywords -X -g1
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47'>
<file name='a.jpg'>
<group name='IPTC' family='1'>
<tag name='Keywords'>a</tag>
<tag name='Keywords'>b</tag>
</group>
</file>
</metadata>
exiftool a.jpg -keywords -X -G1
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47' family='1'>
<file name='a.jpg'>
<tag name='Keywords' group='IPTC'>a</tag>
<tag name='Keywords' group='IPTC'>b</tag>
</file>
</metadata>
Short format (without and with group names):
exiftool a.jpg -keywords -X -s
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47'>
<file name='a.jpg'>
<Keywords>a</Keywords>
<Keywords>b</Keywords>
</file>
</metadata>
exiftool a.jpg -keywords -X -s -g1
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47' family='1'>
<file name='a.jpg'>
<IPTC>
<Keywords>a</Keywords>
<Keywords>b</Keywords>
</IPTC>
</file>
</metadata>
Long format (without and with group names):
exiftool a.jpg -keywords -X -l
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47'>
<file name='a.jpg'>
<tag>
<name>Keywords</name>
<value>a</value>
<value>b</value>
</tag>
</file>
</metadata>
exiftool a.jpg -keywords -X -l -g1
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47'>
<file name='a.jpg'>
<group name='IPTC' family='1'>
<tag>
<name>Keywords</name>
<value>a</value>
<value>b</value>
</tag>
</group>
</file>
</metadata>
Very short and very long format (with group names):
exiftool a.jpg -keywords -X -s -s -g1
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47' family='1'>
<file name='a.jpg'>
<IPTC
Keywords='a, b'/>
</file>
</metadata>
exiftool a.jpg -keywords -X -l -l -g1
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47'>
<file name='a.jpg'>
<group name='IPTC' family='1'>
<tag>
<name>Keywords</name>
<description>Keywords</description>
<value>a</value>
<value>b</value>
</tag>
</group>
</file>
</metadata>
And finally, an example with multiple files and tags:
exiftool a.jpg b.jpg -filename -keywords -X -g
<?xml version='1.0' encoding='UTF-8'?>
<metadata toolkit='Image::ExifTool 7.47'>
<file name='a.jpg'>
<group name='File' family='0'>
<tag name='FileName'>a.jpg</tag>
</group>
<group name='IPTC' family='0'>
<tag name='Keywords'>a</tag>
<tag name='Keywords'>b</tag>
</group>
</file>
<file name='b.jpg'>
<group name='File' family='0'>
<tag name='FileName'>b.jpg</tag>
</group>
<group name='IPTC' family='0'>
<tag name='Keywords'>one</tag>
</group>
</file>
</metadata>
So you can choose the flavour you want. But I'm still not 100% happy with
the "file" container yet, particularly because the name may be confused
with the "File" group. I tried different names ("doc", "item" for example),
but only thing I didn't find anything I liked better.
Also, I'm not convinced that I'm handling list-type tags in the best way
(this is why I included "Keywords" in all the examples). I started out
putting items inside <li> ... </li>, but didn't like this so I
changed to just outputting them separately (except for the very short
format where they are combined into a single string).
Any comments are welcome.
- Phil
|