Loud ramblings of a Software Artisan

Tuesday 29 May 2007

Exempi 1.99.0

I think that a release of Exempi 1.99.0 is due.

This release is the first release towards Exempi 2.0. It is based on Adobe own XMP SDK and unlike the original Adobe code, it builds fine on Linux, and even more on x86_64 (I'm not proud of the fix, but it is as good as it gets for now). This version is much more feature complete than Exempi 0.5.1 as it read and writes (serialize) XMP metadata and load from and to files, including, for supported file types, reconciling the existing metadata.

Download: .tar.gz - GPG signature

It is licensed under the BSD license.

The current API is somewhat not definitive, but I hope it is OK. The documentation still has to be written / generated.

One of the question I got asked is how do you add XMP metadata like CC:Licensing to a PDF[1]. Here is a snippet:

#include <exempi/xmp.h>
...
XmpFilePtr f;
f = xmp_files_open_new("test.pdf", XMP_OPEN_FORUPDATE);
XmpPtr xmp = xmp_files_get_new_xmp(f);
xmp_set_property(xmp, NS_XAP_RIGHTS, "Copyright", "(c) ACME Inc., some rights reserved"
   " - This work is licensed to the public under the Creative Commons Attribution-ShareAlike "
   "license http://creativecommons.org/licenses/by-sa/2.0/");
xmp_files_put_xmp(f, xmp);
xmp_free(xmp);
xmp_files_close(f, XMP_CLOSE_SAFEUPDATE);

Now a little call: Exempi 1.99.0 supports several media format, but not vorbis... I wish I could add support for it. Any idea? I haven't actually dug into it yet.

Notes

[1] could be any of the other supported file types

Tuesday 22 May 2007

XMP support

Exempi2 will use the Adobe XMP SDK as a code base, instead of reinventing the wheel. It will also become BSD licensed to make things easier with the original code.

The reasons are as follow:

  • Adobe XMP SDK implements the whole spec, including scanning XMP out of the various file formats
  • it is somewhat tested (but not on the platform we use)
  • it is less work to fix it than rewriting it
  • it is BSD licensed so perfectly fine for use in GPL applications

The caveats:

  • it needs work to build and work on Linux. I actually have done that.
  • it still fails on 64-bits platforms (fix in progress, don't assume sizeof(void*) == 4)
  • I'm not sure how much it will deviate from upstream as fixes needs to be. I'll do my best to push the changes upstream.
  • It needs a sane API. The APIs are not bad but the are not really designed for dynamic linking as they are based on C++ templates. Templates are not inherently bad, but passing them through dynamic linkage like that is not really a good idea, and worse, it is not language neutral. I'll make some nice C API inspired by what I did in Exempi.

Mental note: explain why XMP is important.