Why Darktable is awesome: Exif preservation

NOTE: This is part of my review of Darktable. If you've come here from a search engine, you might want to read that first for context.

--- exif1.txt	2012-06-29 08:32:39.436422095 +0100
+++ exif2.txt	2012-06-29 08:30:37.772421939 +0100
@@ -1,33 +1,20 @@
 ExifTool Version Number         : 7.89
-File Name                       : DSC_0008.NEF
-Directory                       : .
-File Size                       : 6.0 MB
-File Modification Date/Time     : 2011:10:26 15:44:48+01:00
-File Type                       : NEF
-MIME Type                       : image/x-raw
+File Name                       : img_0001.jpg
+Directory                       : darktable_exported
+File Size                       : 3.2 MB
+File Modification Date/Time     : 2012:06:23 02:30:03+01:00
+File Type                       : JPEG
+MIME Type                       : image/jpeg
+JFIF Version                    : 1.01
 Exif Byte Order                 : Big-endian (Motorola, MM)
+Subfile Type                    : Reduced-resolution image
 Make                            : NIKON CORPORATION
 Camera Model Name               : NIKON D2H
 Orientation                     : Horizontal (normal)
-Software                        : Ver.2.00
+Software                        : darktable 1.0.4
 Modify Date                     : 2011:10:26 15:44:45
-Subfile Type                    : Full-resolution Image
-Image Width                     : 2496
-Image Height                    : 1648
-Bits Per Sample                 : 12
-Compression                     : Uncompressed
-Photometric Interpretation      : Color Filter Array
-Strip Offsets                   : (Binary data 761 bytes, use -b option to extract)
-Samples Per Pixel               : 1
-Rows Per Strip                  : 17
-Strip Byte Counts               : (Binary data 581 bytes, use -b option to extract)
-X Resolution                    : 300
-Y Resolution                    : 300
-Planar Configuration            : Chunky
-Resolution Unit                 : inches
-CFA Repeat Pattern Dim          : 2 2
-CFA Pattern 2                   : 1 2 0 1
 Reference Black White           : 0 255 0 255 0 255
+Rating Percent                  : 20
 Exposure Time                   : 1/250
 F Number                        : 7.6
 Exposure Program                : Program AE
@@ -47,7 +34,10 @@
 White Balance Fine Tune         : 0
 Program Shift                   : 0
 Exposure Difference             : 0
-Preview Image Start             : 6820
+Compression                     : JPEG (old-style)
+X Resolution                    : 300
+Y Resolution                    : 300
+Resolution Unit                 : inches
 Preview Image Length            : 97361
 Y Cb Cr Positioning             : Co-sited
 Flash Exposure Compensation     : 0
@@ -98,13 +88,15 @@
 Sub Sec Time                    : 68
 Sub Sec Time Original           : 68
 Sub Sec Time Digitized          : 68
+Color Space                     : sRGB
 Related Sound File              : 
 Sensing Method                  : One-chip color area
 File Source                     : Digital Camera
 Scene Type                      : Directly photographed
+CFA Pattern                     : [Green,Blue][Red,Green]
 Custom Rendered                 : Normal
 Exposure Mode                   : Auto
-Digital Zoom Ratio              : 1
+Digital Zoom Ratio              : 
 Focal Length In 35mm Format     : 27 mm
 Scene Capture Type              : Standard
 Gain Control                    : None
@@ -114,13 +106,63 @@
 Subject Distance Range          : Unknown
 Date/Time Original              : 2011:10:26 15:44:45
 TIFF-EP Standard ID             : 1 0 0 0
+XMP Toolkit                     : XMP Core 4.4.0-Exiv2
+Rating                          : 1
+Xmp version                     : 1
+Raw params                      : 0
+Description                     : 
+Subject                         : 
+Colorlabels                     : 
+History modversion              : 2, 2, 2, 1
+History enabled                 : 1, 1, 1, 1
+History operation               : temperature, exposure, vignette, graduatednd
+History params                  : 00409c459acc3b400000803f00809f3f,
	3247ac3ca28c00bf0000803f,
	26d5b6427b109142000000bf000000bf0000000000000000000000000000803f0000803f,
	fd0a064000000000d63577c0781baf410000000000000000
+Blendop params                  : 000000000000000000000000, 000000000000000000000000,
	000000000000c84200000000, 000000000000c84200000000
+Hierarchical Subject            : 
+Profile CMM Type                : lcms
+Profile Version                 : 2.1.0
+Profile Class                   : Display Device Profile
+Color Space Data                : RGB
+Profile Connection Space        : XYZ
+Profile Date Time               : 2012:06:23 01:30:02
+Profile File Signature          : acsp
+Primary Platform                : Apple Computer Inc.
+CMM Flags                       : Not Embedded, Independent
+Device Manufacturer             : 
+Device Model                    : 
+Device Attributes               : Reflective, Glossy, Positive, Color
+Rendering Intent                : Perceptual
+Connection Space Illuminant     : 0.9642 1 0.82491
+Profile Creator                 : lcms
+Profile ID                      : 0
+Profile Description             : Darktable sRGB
+Profile Copyright               : No copyright, use freely
+Media White Point               : 0.9642 1 0.82491
+Chromatic Adaptation            : 0.9554 -0.02315 0.06316 -0.02846 1.0101 0.02101 0.01228 -0.02045 1.3297
+Red Matrix Column               : 0.43585 0.22238 0.01392
+Blue Matrix Column              : 0.14302 0.06059 0.71384
+Green Matrix Column             : 0.38533 0.71704 0.09714
+Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)
+Green Tone Reproduction Curve   : (Binary data 32 bytes, use -b option to extract)
+Blue Tone Reproduction Curve    : (Binary data 32 bytes, use -b option to extract)
+Chromaticity Channels           : 3
+Chromaticity Colorant           : Unknown (0)
+Chromaticity Channel 1          : 0.64 0.33
+Chromaticity Channel 2          : 0.3 0.60001
+Chromaticity Channel 3          : 0.14999 0.06
+Device Mfg Desc                 : (dt internal)
+Device Model Desc               : sRGB
+Image Width                     : 2482
+Image Height                    : 1648
+Encoding Process                : Baseline DCT, Huffman coding
+Bits Per Sample                 : 8
+Color Components                : 3
+Y Cb Cr Sub Sampling            : YCbCr4:4:4 (1 1)
 Aperture                        : 7.6
 Blue Balance                    : 1.246094
-CFA Pattern                     : [Green,Blue][Red,Green]
-Image Size                      : 2496x1648
+Image Size                      : 2482x1648
 Lens ID                         : AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED II
 Lens                            : 18-55mm f/3.5-5.6 G
-Preview Image                   : (Binary data 97361 bytes, use -b option to extract)
 Red Balance                     : 2.421875
 Scale Factor To 35 mm Equivalent: 1.5
 Shutter Speed                   : 1/250

Methodology

I ran a file through Darktable, applied some filters, then exported the JPEG, then dumped the Exif from the files into two separate text files, then created a unified diff of the two. I did a quick find-and-replace to colour the diff appropriately.

Lines in red are lines that have been removed. Lines in green have been added. Other lines are provided for context, and have not been changed.

Analysis

Darktable changes very little in your Exif data.

"File Name" through to "JFIF version" are imaginary fields added by exiftool itself. Nothing has changed in the file.

"Software" was simply "2.00" in the original (probably the camera's firmware version). This gets changed to "darktable v1.0.4". This is no big deal unless you need to know your camera's firmware version (!) and don't have the original raw file. All other image-editing software does the same thing.

A bunch of other stuff, from "Subfile Type" to "CFA Pattern 2" changes. This is all stuff that only applies to the original raw file and is only of interest to software working with it.

"Rating Percent" gets added. I didn't rate these images; apparently Darktable doesn't have any notion of an unrated image, and assumes they're all 1-star by default.

"CFA Pattern" isn't being added, look further down in the file. This is just a slight change of ordering in the output.

"Digital Zoom Ratio" gets nuked. I don't know why this is. Digital zoom is a stupid idea anyway.

A bunch of stuff from "XMP Toolkit" onwards gets added. This is mostly 1) the filters that Darktable used on the image 2) the sRGB colour profile it is embedding.

"Preview Image" gets nuked. Raw files have a small pre-rendered preview image embedded to make it possible to see a thumbnail without having to decode the whole image. This being nuked does not matter.

Conclusion

Darktable does not throw away any significant Exif data. This is excellent. It adds some other stuff, specifically the exact post-processing filters and parameters you used, which isn't a problem.

Other raw converters, including some commercial ones, throw away Exif fields that they don't care about. One of the things that came about from having my page on a D2H with a vast number of shutter actuations was that other people would send me photographs from their cameras and ask me to look at their Exif data to find out how many shutter actuations they had. Unfortunately, some of them shot raw files, then used commercial software to convert it, and that software threw away Exif fields it did not care about, including the one which told you how many shutter actuations the camera has. Reminder: People actually pay money for that stuff, and Darktable is free.

I doubt that Darktable actually cares about these fields; it's simply smart and thoughtful enough that it doesn't assume that fields it does not understand are inherently uninteresting to everyone else. Lesser software throws them away for no good reason.

Bravo, Darktable!

Back to my review of Darktable.