So, I’ve been using exiv2 in rawproc for a while now, with various snafus and inconveniences. The straw that broke the camel’s back was 7sec save times to my network storage, 50% owing to writing the un-metafiled image first, then reading it back with exiv2 to add the metadata. So, I decided that’s enough, the v27-28 API change and its reticence to handle PNGs at all just added up and I tore exiv2 out of rawproc. I now save ‘essential’ tags with the libjpeg/tiff/png libraries, works fine. So, notice to the one or two of you using rawproc, there’s that in master, and making its way to 1.5
I also had an AI experience that expanded my insight on the whole thing. In the original file handling of rawproc I’d never figured out the “extra” EXIF tags, e.g. FNumber, ExposureTime, ISOSpeedRatings, and FocalLength, so in the re-implementation I decided to get that right. My original code still didn’t work, so I first decided to get some AI -cogitated routines to at least study. Geminii through google gave me a similar implementation that also didn’t work, and Copilot, whereI got good code for my CAD endeavors told me that the capability to do those tags did not exist in libtiff, first tried to get me to use libexif, then gave me code to build the IFD by-hand. Geesh…
So, I finally just went to the libtiff documentation, where it described exactly how to lay out the code. Spent less time trans-coding that than I did arguing with Copilot. And, in the process I learned a little bit about TIFF organization.
Back to metadata, I got to thinking again about my approach, which is to rely on the raw file to retain all metadata associated with the capture, and populate renditions with only what they need. To that end, I really didn’t need to put fstop/shutterspeed/ISO/focallength in renditions, except to communicate here with other photographers. The real need in renditions is 1) image width and height, because software needs that to lay out the image bytestream, and 2) embedded color profile, so color-managed destinations can do their thing. To work with a rendition , is there anything else?
Correspondingly for raw files, here’s my list: 1) image width/height, both raw and visible area, 2) black subtract value, although I think that could be computed, 3) ‘as-shot’ white balance, for a starting point, 4) mosaic pattern, and, 5) lens distortion and correction data for camera/lens systems that require it (a new one). Right now, to get #5 for rawproc I’d have to engineer an exiftool-based collection mechanism, as that’s the only “library” I know that recognizes and decodes those tags. Really, I already do that for a display tool, wouldn’t be hard to make the data structure available to other code. Libraw makes an effort to supply all the metadata needed for raw processing, may engage them about including it.
Anyway, just sitting here thinking of stuff, always a dangerous occupation…