Author Topic: ipt-v1.trid.xml for XnView IPTC template  (Read 3724 times)

jenderek

  • Sr. Member
  • ****
  • Posts: 361
ipt-v1.trid.xml for XnView IPTC template
« on: March 08, 2018, 11:40:09 PM »
Hello,

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:
https://en.wikipedia.org/wiki/IPTC_Information_Interchange_Model

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". In MP version only import is possible by "load template V1"
menu entry. The used filenames always have one specific filename
extension which is expressed by XML construct:

   <Ext>IPT</Ext>

Therefore i call the trid definition file ipt-v1.trid.xml.

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

   <RefURL>https://www.xnview.com/wiki/index.php/Metadata#IPTC</RefURL>

All IPT files start with 4 byte string "IPTC" which is expressed by:

   <Bytes>49505443</Bytes>
   <ASCII> I P T C</ASCII>
   <Pos>0</Pos>

There does not exist an official file format specifications. With the
help of IPTC specification and hex editor i get an reasonable file
format structure. After magic records seems to be appended. Each record
seems to start with 1 byte describing IPTC field type ( like 5 means
object name). Afterwards length of following data/string is stored as 4
byte value. So mention assumed record structure in remark line. Then
theoretically a string with size FFffFFffh could be stored. But in IPTC
documentation for many strings an upper limit of 32 (like example City)
or 64 (like example object name) is mentioned. Highest value i saw are
2000 (caption/abstract) and 7360 (for rasterized caption). So highest
bytes of string length seems to be null.  This is expressed by tridscan
generated XML file with lines:

   <Bytes>0000</Bytes>
   <Pos>7</Pos>

By this second pattern text files starting with phrase "IPTC" are skipped.


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

With best wishes
J?rg Jenderek

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2667
    • Mark0's Home Page
Re: ipt-v1.trid.xml for XnView IPTC template
« Reply #1 on: March 09, 2018, 04:08:26 PM »
Many thanks!