Author Topic: xml-iptc.trid.xml for XML based XnView IPTC template  (Read 2129 times)


  • Full Member
  • ***
  • Posts: 135
xml-iptc.trid.xml for XML based XnView IPTC template
« on: March 13, 2018, 05:43:07 PM »

some days ago i used graphic tool XnView to add meta information to some
JPEG pictures. The used meta information type i used is called IPTC as
described on Wikipedia page by URL:

The work flow varies depending on software versions. I test it with
classic XnView version 2.43 and new XnView MP version 0.89. By Hot-key
Ctrl-I screen is opened which is called "export IPTC data" in classic
version or "edit IPTC/XMP" in MP version. In classic version data can
be exported/imported in binary form by menu entry "save template" or
"load template" with file name extension "IPT". In MP version only
import of this format is possible by "load template V1" menu
entry. But this version can import/export the IPTC information as XML
structures. The used filenames always have now specific filename
extension "IPTC" which is expressed by XML construct:


Therefore i call the trid definition file xml-iptc.trid.xml. By
current definition xml.trid.xml such files are only described as
"Generic XML (ASCII)" with wrong file name extension ".XML" ( see
output/trid-old.txt) by starting pattern

   <ASCII> . ? x m l</ASCII>

That XnView software can handle IPTC is mentioned inside it's own
wiki. So i describe this by reference URL by XML construct:


All example files start with first line like:
 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE iptc_template><iptc_template version="1.0">

So this becomes the more matching pattern in new trid divinations file.
When looking in examples like cq5dam.web.4-3.6retina(3).iptc i saw
that software apparently always writes hundreds of tag elements
although only a few IPTC fields contain content. So i create
artificial iptc2-onetag.iptc with only 1 tag element by deleting empty
IPTC tags. Then test if software accepts this template. Yes, it does.
By this step "TAG_" string now only appears in global string section


When XnView MP exports IPTC data second line always start with parts


That are 4 spaces at the beginning, that are used to indent XML
structure elements. This should only be used to make text more
readable for humans. So other indent style should also do it. So i
replace 4 space characters by 1 tabulator character like in example
iptc2-tag7.iptc. So second line now looks like:

Then test it. Yes XML parser inside XnView software accept this IPTC
template. So pattern starting at offset 0 shrinks.

With new trid definition file all inspected IPTC are now described more
precisely (see appended output/trid-new.txt.txt). TrID definition,
some examples and output are stored in archive I hope that
the XML file can be used in future version of triddefs.

With best wishes
J?rg Jenderek


  • Administrator
  • Hero Member
  • *****
  • Posts: 2036
    • Mark0's Home Page
Re: xml-iptc.trid.xml for XML based XnView IPTC template
« Reply #1 on: March 14, 2018, 12:11:39 PM »
Thanks for the new def!