<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<info>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
<title>Photographic metadata and digiKam</title><biblioid class="uri">http://norman.walsh.name/2007/06/08/digikam</biblioid>
<volumenum>10</volumenum>
<issuenum>57</issuenum>
<pubdate>2007-06-08T07:40:40-04:00</pubdate>
<date>$Date: 2007-06-08 09:46:56 -0400 (Fri, 08 Jun 2007) $</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2007</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>I'm still trying to find a good way to manage photographic metadata.</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#PhotodataOrg"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#Photography"/>
</info>

<para xml:id="p1">Several months ago, when I
<link xlink:href="/2007/04/01/feisty">upgraded to Feisty</link>,
my nascent
<link xlink:href="/2006/09/13/photodata">photographic metadata</link> web application
stopped working. Although I'd abandonned all realistic hope of turning it into
an application that others would use, it was working pretty well for me. Pretty
well until it stopped completely:</para>

<programlisting>/usr/lib/ruby/1.8/rdf/redland/resource.rb:5:in `append_features': cyclic include detected (ArgumentError)
	from /usr/lib/ruby/1.8/rdf/redland/resource.rb:5:in `include'
	from /usr/lib/ruby/1.8/rdf/redland/resource.rb:5
	from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        …</programlisting>

<para xml:id="p2">Web searching revealed that I wasn't alone, but didn't reveal
any obvious messages of the form “do this to fix the bug” short of
upgrading the whole ruby/redland infrastructure. I sent off some mail,
<link xlink:href="https://bugs.launchpad.net/ubuntu/+source/redland-bindings/+bug/102845">reported
the bug</link>, and waited. I poked at doing my own upgrade of the
ruby/redland infrastructure but gave up when the obvious five-step:
download, unpack, configure, make, install didn't fix the problem.
</para>

<para xml:id="p3">I was confident that one of my routine “<command>apt-get upgrade</command>”s over
the next few days or weeks would make the problem go away. No such luck. So when
I stumbled, by random chance, over
<personname>
      <firstname>Mark</firstname>
<surname role="suppress">Nottingham</surname>
    </personname>’s
<link xlink:href="http://diveintomark.org/archives/2006/06/26/essentials-2006">Essentials</link>
list and saw his description of
<wikipedia page="Digikam">digiKam</wikipedia>:</para>

<blockquote>
<para xml:id="p4">It’s just like iPhoto except it calls albums “tags”,
exports to Flickr for free, exports to HTML that validates, stores my
important metadata in a SQLite database, can be operated entirely with
a keyboard, and doesn’t suck.</para>
</blockquote>

<para xml:id="p5">I thought I'd give it a try. Converting my several tens of
megabytes of RDF/XML metadata into several tens of megabytes of SQL so
that I could manufacture an SQLite database that
<application>digiKam</application> would swallow took a few hours, but
I managed.</para>

<mediaobject role="flickr">
    <!--digiKam editing The TAG at Google-->
  <imageobject xlink:href="http://www.flickr.com/photos/ndw/535305945/">
    <imagedata fileref="http://farm2.static.flickr.com/1289/535305945_615e08cb93.jpg"/>
  </imageobject>
</mediaobject>

<para xml:id="p6">After tagging a few dozen photographs, I have to say, I think it's probably
good enough. I have some gripes, but they're perhaps the result of design decisions
more than bugs, so I'm unlikely to pursue any remedy for them. In case you're
interested:</para>

<itemizedlist>
<listitem>
<para xml:id="p7">As far as I can tell, <application>digiKam</application> expects
you to store all of your photographs in one location, system wide. If
you attempt to import new photographs, it begins by copying them into
that location. This is contrary to how I work, and seems unlikely to
work for anyone with a really large collection of images. I want to
point <application>digiKam</application> at a location and say “let's
tag some of these”, then later, point it at another location and do the same.
Ideally, it would let me move images between locations, preserving the
database-backed metadata as I did so.</para>
<para xml:id="p8">Speaking of metadata, if you start
<application>digiKam</application> and it can't find some of the
images that it tagged before, perhaps because some disk isn't mounted,
it insists on deleting all the metadata associated with those images.
I appreciate the option of deleting the metadata, but I resent being
forced to. I wish it had an option to just ignore (but preserve)
metadata for the missing images. Always having all the relevant disks
mounted is going to become inconvenient.
</para>
</listitem>
<listitem>
<para xml:id="p9">The <application>digiKam</application> database contains a
comment associated with each image and a set of tags. I wish it
allowed me to associate arbitrary key/value pairs with each image, but
I can see how that would complicate the database design. Lucikly, the
tags <application>digiKam</application> supports are hierarchical, so
I can do just enough mapping. I associate the top-level “People” tag with
with the <literal>foaf:depicts</literal> property, “What” with
<literal>dc:subject</literal>, and “Where” with
<literal>dc:coverage</literal>, for example.
It's not perfect and it doesn't really work for titles, credits,
copyrights, descriptions, comments, or geographic metadata. I work
around those with the same “structured comments” hack that I use in my
PDA.</para>
<para xml:id="p10">The way <application>digiKam</application> expect you to deal with
all this other metadata is by storing it directly in the image using the
<wikipedia page="Exchangeable_image_file_format">EXIF</wikipedia> and
<wikipedia page="International_Press_Telecommunications_Council">IPTC</wikipedia>
standards. On the one hand, that's exactly the right answer. I wrote
<link xlink:href="http://norman.walsh.name/2005/projects/jpegrdf">JpegRDF</link>
years ago so I could do exactly that.
On the other hand, the plugins that support editing that data don't seem
to support the <wikipedia page="Raw_image_format">RAW</wikipedia> format from
my camera. And also, photographs are one of a very small number of truly
irreplacable digital artifacts in my life. I'm very, very conservative about
letting applications edit them. </para>
<para xml:id="p11">Finally it doesn't seem to be possible to
make changes to the
<wikipedia page="Exchangeable_image_file_format">EXIF</wikipedia> and
<wikipedia page="International_Press_Telecommunications_Council">IPTC</wikipedia>
data on a group of files at once.</para>
<para xml:id="p12">So I make do with structured comments. I expect to pull all the data out
of SQL and turn it back into RDF eventually anyway.</para>
</listitem>
</itemizedlist>

<para xml:id="p13">I haven't figured out how I'm going to update the database automatically
with new images (preserving, for example, GPS and other metadata from my RDF sources).
But I suppose it's just
<wikipedia page="Small_matter_of_programming">SMOP</wikipedia>.
</para>
</essay>

