A client has an image bank with many pictures. They have categorised those pictures in a hierarchy. Now they want to move the pictures to a new image bank and I am asked to put this hierarchy into the EXIF or XMP data inside the pictures. Technically, using exiftool, that is all very easy, but I cannot seem to find any conventions of which field to use and how. So who knows how to store this kind of hierarchical data in EXIF?


4 Answers 4


So after a little digging and with the help of Murat's hint I found the following field in some pictures. This basically is the way that Adobe Lightroom stores the information and it could be used as a defacto standard in your project. We already went for a similar solution with our own field name and no use of rdf, but just to close this question here is the Lightroom solution as exported by exiftool:


Well you can find a list of XMP field names used by common photo software on this page.

For example, digiKam uses the TagsList field name in XMP metadata to store its tag hierarchy. So when I mark an image with the "Brighton" sub-tag which is nested under the "East-Sussex" sub-tag, nested under the "UK" sub-tag, nested under the "located" top-level tag, and also the "Friends" sub-tag nested under the "populated" top-level tag, digiKam adds this to the TagsList field:

populated/Friends, located/UK/East-Sussex/Brighton

This format does forbid that individual tag values contain spaces or forward-slashes, but I believe tags should be compact and unique tokens with a defined meaning, not verbose free text, so this constraint should not be a problem.

To be honest it shouldn't matter how you choose to store the information so long as it works for you at the time and so long as you document your decisions so that future users can migrate the metadata to a new format in future if the need arises.

I'd say it's more important that you pick a format and then stick to it consistently. Consistent data can be translated and migrated automatically from one format to another. Inconsistent data is garbage which requires hours of human intervention every time it has to be processed. (And I should know: I usually seem to be the one who ends up having to process it.)

  • \$\begingroup\$ I am an IT Consultant specializing in migrations. Your solution is fine for small sets, or even larger ones if you use them alone. The trouble is that there is no central way of administering your hierarchy, if you would want to move one tag to another level or reorganise a branch, you would end up editing each separate field again. So what I really want to know is: is there no better standardised way to do this? If there is not we might end up doing it as you suggest, using bots to do the tagging. \$\endgroup\$
    – titusn
    Jan 25, 2014 at 0:00
  • \$\begingroup\$ The only way to have a hierarchy structure managed centrally would be to use a database system which maintains the structures in a single table, so that the hierarchy structure could be reorganised with ease. But this is not how metadata in image files works, because each image file stands alone. If you change the way you want the hierarchy structured, you have to update the metadata in every image file one after another. Using XMP sidecar files will reduce the time it takes to make such updates, but you then run the risk of separating the image file from its metadata file. \$\endgroup\$
    – Bobulous
    Jan 25, 2014 at 19:48
  • \$\begingroup\$ The risk to splitting the metadata from the image is balanced by the safety of never needing to write to the image file - so it's not so easily cut & dried, if the files have unique names then matching them up would be easy if you had to. \$\endgroup\$ Jan 25, 2014 at 22:15
  • \$\begingroup\$ I meant that one should indeed use a db and then store for example category id's in the images. Anyway the main point of my question still remains, namely: is there no standard at all for this? That would rather surprise me. \$\endgroup\$
    – titusn
    Jan 26, 2014 at 8:54
  • \$\begingroup\$ Nope - there isn't a standard. One was never considered necessary since any kind of organising or searching was and usually is done via keywords. It's also worth keeping the full metadata in/with the file because that way it retains the metadata if you need to supply it to a third party. The database side of things is already a solved problem if you use windows since the Indexing Server service reads and caches the metadata from the files. \$\endgroup\$ Jan 28, 2014 at 10:27

You can suggest to your client to use a Digital Asset Management to manage his image bank. The most modern DAM solutions can automatically save tag hierarchy to XMP.

EXIF is mainly used for storing technical camera and image shooting info.

Another standard is IPTC but it is obsoleted and has significant limitations to length of the fields.

Hiearchical info is supported by XMP/MWG specification, but I know very few programs that are supported it well.

The most popular approach is to store hierarchical data inside your XMP (MWG) is by separating each level with the "|" separator. This symbols is used by a lot of DAM solution (unofficially), including our Daminion, Lightroom, IdImager, MS Photogallery, iView/MediaPro, etc...

So don't re-invent a wheel and consider a good DAM solution!

  • \$\begingroup\$ Thanks for the pointer to XMP/MWG, will look into that. It's for a government, they decided to build their own DAM... \$\endgroup\$
    – titusn
    Jan 28, 2014 at 12:34
  • \$\begingroup\$ To be honest it would be the last thing that I'll do if I'd work for a government. They should imagine that DAM is not a single task resolver, this is a combine with a lot of features that should be designed, implemented and worked together. There are hundreds of media formats and dozens of metadata specifications and hundreds of thousands developer hours (see dollars) behind an affordable DAM solution. We at Daminion Team, are involved into this task since 2003 and there are a lot of things that we plan to do. Just some thoughts. \$\endgroup\$ Jan 28, 2014 at 13:23

Taxonomy? Exiftool has supported writing Darwin Core as XMP for a while now.



Resource Space is a free software DAM which uses exiftool as it's metadata backend. You can customize it to support Darwin Core.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.