Atkelar (atkelar) wrote,

WTF coding #5b - Specifications III

And again I'm experiencing the joy and fun of "interpreting standards".

This time, it's a document metadata format called "XMP". It is a subset/extension
of a W3 recommendation for metadata, defined by Adobe and thus read by most applications
who care about metadata in the first place.

XMP stores the serialized data in an XML format... which would be awesome... if it
weren't for the fact that it allows you (i.e. the writing application) to chose between
half a dozen ways of expressing the same content. And I'm not talking about the
optional stuff that XML lets you do, that's what we have XML parsers for.

Reading XMP metadata in a reliable and non-lossy way turned out to be more than a
few hours of work. What the specs are clearly missing, is a simple parsing rule
overview in the style of: "if this condition is met, the content is a..." - the
information is there, but randomly distributed across the entire document. It's
another case of "implement all at once or nothing at all"

So... after spending hours and hours on implementing the "xml:lang" support
for multiple language versions of the same content, I gave it a test run...

     <rdf:li xml:lang="x-default">Test</rdf:li>
     <rdf:li xml:lang="de-DE">Versuch</rdf:li>

The above fragment was created by my code. According to the specs, the language
alternative encoding for the "Dublin Core Title" is correct.

I tried that fragment as a sidecar metadata file for a camera raw picture and
low and behold: Adobe Bridge actually displays "Test" as a title for it!
Yay! ... umm ... but what about the other language? There doesn't seem to be a way
of accessing that content in the UI. Better yet... when I edit the property in the
UI, Bridge (or the Adobe XMP library more likely) changes the fragment to the
following content:

     <rdf:li xml:lang="x-default">Test, 2</rdf:li>
     <rdf:li xml:lang="de-DE">Test, 2</rdf:li>

...which is a bit pointless IMHO. Granted, the changed title in one language is
likely to need reflection in the others... but just dumping all and replacing them
with the entered text? Really?

So, this is another prime example of the vendor who actually came up with the
standard implementing it in a semi-serious way only. How can one win in this game?
Tags: coding, software development, wtf

  • Videos and other stuff...

    As you might have noticed, I decided to keep up my YouTube video production at an every-other-week schedule as close as possible. So far, since…

  • SX-64 Restoration Project

    This is going to be a rather long story about me and my very first computer... or rather not "mine" as in "owning" but rather "my first" as in "the…

  • The End of YouTube

    That's it... I've been tolerant with policy changes around YouTube for quite a long time now. But the recent decision to "improve the commenting…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded