Reply to comment
digiKam and PNG metadata writting mode on the fly
Submitted by cauliergilles on Thu, 2008-07-24 20:13It's holliday time for me currently. Since two week, i still in south of France near Mediterranean sea. Summer is nice to play on the beach with my familly.
But for my hot brain, it's difficult to still without a little programming task to do for open-source world...
Here i don't have a speed internet connection. My laptop (a Toshiba Satellite) has a winmodem which run only under Windows Vista. It's not easy to sync my local copy of current subversion implementation of digiKam and co. So i need to work on other important stuff where source code no need to be synchronized every day to play with it: Exiv2
Exiv2 is a friend project for digiKam. Coordinate by Andreas Huggel, this library is the core implementation to play with all photo metadata in digiKam. I have already contributed to Exiv2 in the past, to make a Minolta makernotes parser, support internationalization, PNG metadata reading support, plus a lots of tests and reports about XMP and TIFF writting mode support.
PNG support in Exiv2 has been limited to read Comment/Exif/Iptc/Xmp metadata. I know very very this stuff: i have writte this code. But PNG is a very important OpenSource file format and we need more than this. From my viewpoint, PNG is the best format to host photo data: 16 bits color depth, ICC color profile, all photo metadata (Comment/Exif/Iptc/Xmp), loss less compression...
Also LibPNG is very well documented and W3C specification is wonderfull to read. PNG is better than tiff/DNG: file format is simple to understand (a serialization of data chunk, compression give similar results than TIFF deflate (and sometime it's better). PNG is very well supported in photograph world: it's a standard. Of course, no digital camera support PNG, but it's a perfect image format to host your fixed images made in your photograph workflow. I use PNG everywhere on my computer: all my corrected photo, especially all RAW files that i prepare for printing and for backup. I never use TIFF (which lack all makernotes by libtiff - of course recent TIFF writting mode support from Exiv2 fix this problem). JPEG is only used on my computer for web publishing.
This is why improving PNG support in Exiv2 is very important. Like TIFF writting mode support have been implemented by Andreas in current Exiv2 implementation, i have not resisted to implement PNG writting mode. After one week of intensive work (between two beach sessions of course) to refactorize PNG parser and to fix several bugs with XMP support, i have add a lots of code to be able to writte PNG metadata on the fly, like JPEG and TIFF.
To be more precise, digiKam will be able to update or fix comment, Exif, Iptc, and Xmp informations without to re-encode image data. It's fast and very suitable in digiKam, especialy to backup database informations in PNG files. Note than currently, digiKam writte all PNG metadata when the image is saved from editor, using LibPNG.
My new PNG code will be available for next 0.18 Exiv2 release. I will publish it when i will back from holliday

