Non-electronic lenses on Nikon Zf, Exiftool and darktable question

I am a long time darktable user and routinely shoot a Leica M10 and a Nikon Zf. On the Zf, I have a ‘dumb’ adapter with no electronic contacts and also a TTArtisan 6-bit adapter. Both allow me to mount Leica M lenses on the Zf. The TTArtisan adapter embeds data into the EXIF for lens used. The ‘dumb’ adapter I have to set the ‘Non CPU lens data’ to be the focal length in a menu.

Before I import any of these raw (.nef) files into darktable, I run a shell script that will update the lens data using Exiftool. An example is: “exiftool -g -a -if ‘$exif:LensModel# eq “”’ -if ‘$exif:focalLength# eq 50’ -overwrite_original -exif:lensInfo=‘50mm f/1.5’ -lensMake=‘Voigtlander’ -lensModel=‘Voigtlander 50mm f/1.5 Nokton Aspherical II MC’ -FocalLength=‘50’ -MakerNotes:Lens=‘50mm f/1.5’ *.nef”

When I then import this file into darktable, the Lens info still shows as ‘Manual Lens No CPU’. Looking at the Exiftool output, all of my lens data is updated correctly. The only thing I can think of after looking at the sourcecode of darktable is something to do with some Nikon specific tags such as “Exif.NikonLd4.LensID” (in the src/common/exif.cc file) and it checking that value first.

If I use the same above command on a file when using the TTArtisan adapter, then the lens names show up correctly. So it’s something to do with how Nikon is flagging something when using a non-electronic lens and that flag is being picked up by darktable somehow.

Has anyone dealt with this before? Thank you.

I personally recommend not modifying your raw files this way. You can use a ~/.exiv2 file to map the correct names to the metadata. Its been detailed a bunch of times here before.

Thanks for the tip. I’m guessing if I use exiv2 then other programs like darktable will recognize that?

Darktable uses exiv2 to read the data.

Other programs that use exiv2, yes, assuming they match the lens name similar to darktable.

I’m on the cellphone, so I won’t open the code to check. There is a priority when reading the tags. I think it goes xmp, then iptc, and then exif. You likely need to edit the main one or all 3.