[Digikam-devel] Image history in metadata

Andreas Huggel ahuggel at gmx.net
Sun Jun 13 10:42:51 CEST 2010

Hi Marcel,

Technically, I think storing an XML structure in an XMP text field is
not a problem, if you don't mind the overhead: First, parse the XMP
with exiv2 (which uses the expat XML parser), then separately parse
the embedded XML text (potentially using another XML parser).

Alternatively, you can look at specifying the image editing history
"language" directly in XMP as you said, either within the digiKam
schema or in a new schema for this purpose. XMP allows for more than
the common basic types; it also supports things like structures,
qualifiers and nested types. See here for some examples in an exiv2
context and to get an idea: http://www.exiv2.org/example5.html and the
XMP specifications for details: http://www.adobe.com/devnet/xmp/. Of
the two options, I would prefer this one.


On Fri, Jun 11, 2010 at 20:01, Marcel Wiesweg <marcel.wiesweg at gmx.de> wrote:
> Andreas,
> for the GSoc project about non-destructive image editing we have come up with
> an XML format in which we would like to store the image history.
> Now thinking about storing this in metadata, we have crossed the problem of
> storing XML in XMP's XML. Alternatively, the structure could be inserted
> directly in XMP, but it is not easily mapped to a single list or map, so using
> bag or other XMP structures appears not easy.
> For reference, see some example XML at the bottom of this mail.
> What is the best way to put this into metadata?
> Thanks, Marcel
>> We are indeed using XML formatted directly in digikam. The purpose of this
>> XML creation is not primarly for storing this in the metadata, but rather
>> as a specified format that can describe the changes, slightly inspired by
>> OpenRaster's XML. We can add attributes to all nodes and extend it in the
>> future.
>> The XML will also be used in other places, and it's a bit more complex than
>> a simple map, which would be too limiting. We will also store the XML in
>> the database.
>> So far I did not think about the implication that XMP is also based on XML,
>> and we now have the purpose of storing XML in XML. Hm.
>> So we either really store it as a string, or we try to integrate it into
>> XMP. Is XMP flexible enough to carry a custom chunk of xml?
> history>
>        <file type="raw">
>                <filename>pict1234.nef</filename>
>                <originaluuid>asdf-1234-ghjk-5678-tzui</originaluuid>
>                <creationdate>2010-05-05.16:23:56</creationdate>
>        </file>
>        <filter name="digikam:rawimport" version=1 category="reproducible">
>                <description>"Manual Raw import"</description>
>                <param name="interpolationMethod">Bilinear</param>
>                ... // many more params
>        </filter>
>        <file type="intermediate">
>                <filename>pict1234-1.jpg</filename>
>                <fileuuid>ertz-3456-sdfg-1234-fghj</fileuuid>
>        </file>
>        <filter name="digikam:crop" version=1 category="reproducible">
>                <param name="rect" x="10" y="10" width="90" height="40" />
>        </filter>
>        <file type="current">
>                <filename>pict1234.jpg</filename>
>                <fileuuid>dfgh-4567-2345-rtzu</fileuuid>
>        </file>
> </history>

More information about the Digikam-devel mailing list