Tagging your images for easier retrieval

Although I delete most of the images I shoot, although I put each month’s keepers in a directory, although I have taken the habit of printing a “digital contact sheet” each month, I am faced with a growing number of images and they need to be manageable somehow…

One of the main tool for that is image tagging and guess what? It is the subject of this entry.

Tagging: the principle

The idea is to add keywords (“tags”) to your images, which can then be searched through. Simple, like all great ideas are.

In my opinion (and I am not the only one), it is important that the tags are attached to the image file as metadata. This way, moving, copying, renaming a file will not have any influence on its tags – as opposed to having something like a ~/.tagfolder.

It is also important that the format of the tags is standard so it can be read by your image viewer (think virtual slidehow), written by whichever tool you have your image open with and be searched by desktop search tools.

Tagging: the standard(s)

Now the good news is that the first standard for tagging as metadata was defined in 1979 and is known as IPTC (wiki). It was revised in 1991 and in 2001 Adobe further developed it into XMP (Extensible Metadata Plateform – wiki, web) which is based on xml embedded as image metadata.

Since May 2007, Adobe licensed its XMP SDK (Software Development Kit) under a BSD Licence. There has also been some collaboration going on between Adobe and IPTC, resulting in the “IPTC Core Schema for XMP”.

So the standards exist and there are 3 libraries implementing them under Linux: libiptcdata (for IPTC, yeah!), libexempi (for XMP, developped by Hub Figuiere, as a side-product of libopenraw) and the Exiv2 library (for image metadata in general: exif, XMP and IPTC).

Tagging: GThumb support

Now the question is whether my $favorite_image_viewer implements IPTC or XMP tagging. In my case, favorite_image_viewer = GThumb and I am lucky. GThumb can use libiptcdata and is apparently considering libexiv2.

Now why Ubuntu compiles GThumb without libiptcdata is beyond me (bug report).

So I added libiptcdata a few more -dev packages to my Ubuntu and recompiled GThumb. Now I can add tags (“Categories” as they are known by GThumb) and retrieve them from Nautilus, for example. Cool.

Tagging: other applications

There is a pyGTK image-viewer/manager called JBrout which focuses on metadata management. Although it is ony on its 0.2 version, the tags management is working very well.

Worth mentioning also is Sagittarius. Its development just started (version 0.1) by Vivosz. It is a mono-based app and focusing only on metadata management – I haven’t tested it.

Unfortunately Tracker, Gnome’s default desktop search tool, doesn’t yet support IPTC metadata. But is is one of their summer of code project. Apparently Beagle does.

Tagging: using tags

As I was told in academy, sorting the technical side is just a first step. What matters is the usage. And using tags asks a few questions: how many tags? what do they cover: the place where the image was taken, the technique used, the content of the image, its style? If someone knows about “good tagging practice” I would love to hear from you.

In the meantime, here is what I have come up with. I use the first 2 letters of my tags for its category: pl = place, pe = people, te = technique, th = theme. Then I have the tag itself: pl_geneva, te_black_white, th_mountain. This allows me to have my tags ordered by category and then pick the tags I need inside each category.

Here is a screenshot of adding tag(s) to an image from my list:

And here is what is like to have a “virtual folder” of all my black & white images for 2008 – with the search dialog on the side. The interesting thing here is that you can use these search result to do any mass editing you want, like adding a new tag and removing the current one, for example – since tag renaming is logically not possible.

Tagging: one last word

None of my entries would be complete without a last word… While the technical infrastructure for standard tagging is shaping up pretty well on Linux, the usefulness of tagging is in the right choice of keywords and a standard use of them over time. You don’t get out of the GIGO principle…

And, just because a proper entry also contains a “conclusion image”,  here is my favorite pic from last week-end hot air balloon show in Geneva:


21 Responses to Tagging your images for easier retrieval

  1. jan says:

    what i really hate about tagging under linux is, that the two main applications f-spot and digikam are still not compatible and won’t be at least until july…

  2. Donncha says:

    What I hate about tagging is that I have possibly 75,000 photos. They’re all in dated folders, and most folders have descriptions but almost none of them are tagged. I tried ocasionally to start tagging but the task is daunting.

  3. Hub says:

    I’d just forget IPTC (IIM) and use XMP that does more than that. XMP is really the new standard, more versatible than IPTC.

    Other advantage is that with sidecar files it also support RAW files.

  4. jcornuz says:

    Hi there,

    Tagging IS a tedious process, especially if you haven’t done it since day 1 – I have a fair chunk of files to tag as well :-/

    This makes it even more important to chose the right technology – I want all my apps to use the same standard. Apparently, XMP support is work in progress for Digikam and GThumb – not so sure about F-Spot .

    Hub, I had the feeling XMP is the way to go, but GThumb doesn’t support it yet (only in CVS).

    Take care,


  5. jan says:

    i am getting confused now, but iirc has f-spot tagging been xmp-based since day one.

  6. jcornuz says:

    Hi Ale,

    I didn’t know about Xmp Manager, but that looks promising. Is this an add-on to Nautilus or is it also a stand alone program?

    Take care,


  7. Janne says:

    I use Flickr, so all images I have there are tagged already. Whatever tag system I’d use at home would need to be compatible with that API – no way am I going to do two sets of tags, or manually reinput them for every image. Anybody knows what the status is there?

    One tip about tags: prefixes and categories like you do are fine if it really helps you. But it really isn’t necessary; placenames, techniques and technical info, people names and so on are all distinct enough that you rarely have a tag that could mean either. You really don’t need “pl_berlin” for instance, just “berlin” will work fine. Same for “BW”, or “sepia” or “50-135”, or “K10D” and so on.

  8. Roel says:

    @janne, I think your idea (to retrieve tags from Flickr photos and insert them as XMP tags into your local photos) is great! However, I haven’t seen it implemented anywhere yet.

    On Linux, it could maybe be created in the form of a plugin for one of the photo management applications (F-Spot, Digikam). That would require two steps, though:
    1. Link a local photo with one on Flickr. I’m not sure this would be easy to implement as something automated.
    2. Sync tags between Flickr photo and the local photo. The Flickr API probably allows you to retrieve tags, but then they need to be written into the photo metadata in either EXIF, XMP or … form.

    It would be very interesting, though. 🙂

  9. Janne says:

    Roel, actually I was mostly concerned with the case of uploading pictures. I enter tags for photos that I upload (using jUploader in my case), and I’d wish that I could add tags in Gimp or gThumb instead and have jUploader (or equivalent) automagically submit those as tags for Flickr as well.

    But yes, being able to suck down all the tags I already have and have them associated with the right images locally would be pretty great too 🙂

  10. jcornuz says:

    Hi Janne,

    My idea with the first two letters was to have my tags “automagically” sorted by categories and then name when put in alphabetical order by GThumb. I since realized that JBrout allows free tags re-arranging and I hope the next version of GThumb will do that, too.

    Thanks for the tip 🙂


  11. chris says:

    There’s another program that adds and administrates IPTC tags of JPEG images: mapivi (http://mapivi.sourceforge.net/mapivi.shtml). Unfortunately, in order to install it on Ubuntu, a few perl libraries have to be installed manually, but it works very well.


  12. Jacob vP says:

    Hello! Tagging photos with gThumb, now thats interesting. But as I am a Ubuntu-newbee I wonder what you mean when you say that you’ve recompiled GThumb? I checked in Synaptic and I have libiptcdata (-0, -bin and -doc). But how do I get everything to work? I have zero programming experience. Any “fool-proof” tips?
    /Jacob vP

  13. jcornuz says:

    Hi there,

    @Chris, thanks for the tip – I’ll have a look at Mapivi (when time permits). Looks interesting, although I am not a fan of the Tk interface.

    @Jacob, unfortunately, there isn’t a “fool-proof” way to get GThumb with IPTC. And (as Hub said earlier) the mainstream standard is XMP – so all my images tagged via GThumb with IPTC tags will have to be converted to XMP tags. However, IPTC / XMP are coming to GThumb – just a question of patience.
    Furthermore JBrout does a good job at tags support, editing, searching, etc…

    Take care.


  14. Jorge says:

    Hello Joel,

    Unlike Janne, I really find very useful the way you use tags. Let say I have: pe_joe, pe_maria, pe_carl… With this I can do a search with pe_* and it will bring ALL people…If I don’t do this there’s no way to bring all persons UNLESS I add a second tag to each person (e.g. I will tag Joe as “joe” and another tag for “person”). That’s double work 🙂

    Anyway…I started tagging my photos like this and then went to Gthumb to perform a search and to my surprise I couldn’t search these “categories” by using regular expression. I was going to do a search, for example, on “pe_*” but I can’t do that. So my question for you Joel is… Since you are tagging like this..the only benefit I see for doing this is to be able to search for this “prefixes” (which are like MAIN categories)… What program do you use that permits you perform this kind of search?

    All the best,

  15. jcornuz says:

    Hi Jorge,

    Interesting – to be honest with you, the reason why I chose this organization is because GThumb lists the tags in alphabetical order and I wanted to have people with people and places with places.

    I don’t know if pe* would work in GThumb – Jbrout is a bit more advanced with tagging so it may be worth trying; I’ll let you know if I manage to get anywhere. Otherwise, just tick all the pe tags in the search box – easier since they are alphabetical 🙂

    By the way, do you use GThumb’s “native tags” or IPTC (or XMP)?

    Take care,


  16. Jorge says:

    Hello again Joel,

    I see your point about listing your tags alphabetically. It’s a good point I must say 🙂

    Well…you see I’m starting with this “tagging” thing….I just paid attention to this when you came up with this post really and a couple of weeks later I revisited (the post) in order to start working with this so I fired up gthumb (I’m using Fedora 8) and started tagging a couple of images. The thing is that , after I tagged some photos, I went to the folder were the images were and checked their “modification time” and I didn’t see it changing…so there was no way gThumb was writing the metadata on the file (since it didn’t change the mtime) UNLESS it was doing so and changing back the mtime as it was before (I doubt it)…so to answer your question I think I’m using gthumb’s own db for storing tags (which I don’t like).

    Before starting I did:

    ldd /usr/bin/gthumb | grep iptc
    libiptcdata.so.0 => /usr/lib/libiptcdata.so.0

    then I knew that IPTC support must be there…but I just don’t see WHERE in the app I enable it 😦 Anyway, I tagged just a couple of photos as I’m playing around with this before I start tagging all my photos…

    After reading your post and doing some search on tagging..it seems XMP is the future… so I started doing a search on “xmp linux” and it seems the only thing we have for now is the “XMP Manager” that works with Nautilus. I’m a KDE guy but I’m willing to use Nautilus just for this task 🙂 (I have all gtk & gnome libs).

    I have some questions for you, from a newbie in this area:

    1- How do I enable IPTC in gthumb? My binary seems to be linked with the iptc library but I don’t see anything related to IPTC within gtumb. Perhaps it was linked with, but not enabled?

    2- If I start tagging using IPTC…..and then XMP rules the world… do you think (or is there now) any tool that will convert from IPTC to XMP?


    p.d I have some questions regarding the way you store your pictures (folders based on year, month etc…) as I’m also reorganizing my folder hierarchy…but I’m going to ask about it on the proper post later or tomorrow.

  17. jcornuz says:

    Hi Jorge,

    I only recompiled GThumb with libiptcdata and its development package. It picked it by itself – when opening the image properties in Nautilus, it finds my tags. Same with JBrout.

    I came across a command to copy IPTC to XMP – it will probably be in another entry once tagging gets a bit more mainstream support 🙂

    Take care,


  18. Claudio Cicali says:

    Hi, why not using the “machine tag” syntax? Instead of “_” as the separator from broad category to tag (pl _ berlin), use http://en.wikipedia.org/wiki/Machine_tag

    Just a thought 🙂

  19. Prasinos says:

    Playing devil’s advocate here: Is tagging really needed? I mean, you can use the “Comment” EXIF field for writing a descriptive title and then sort through your photos with full text searches on the comment field. Wouldn’t that work?
    I am test driving various photo managing applications (f-spot, gthumb, etc.) and I am surprised that they seem to forget that a photo first and foremost has a title…

  20. isiomer says:

    Hi all,
    I agree with what Prasinos says…
    why not use convert tool or exiftool to do the tagging….anyway,I am intrigued by what tagging actually means at the bits level…where is the tagged data stored and all…….are the photo results returned by google tagged…I could not find any tag using “exiftool “and “identify”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: