darktable lens correction: Auto-detection failing for Viltrox 23mm f/1.4 (XF Mount)

Hi everyone,

I’ve found similar posts regarding this issue, but the solutions don’t quite seem to fit my specific problem.

I am using a Viltrox 23mm f/1.4 for Fujifilm X-mount. In darktable’s “lens correction” module, I get the message “Camera/Lens not found”. While I can manually select the correct entry from the Lensfun database (“Viltrox, Viltrox AF 23mm 1.4 XF/Z/L”), the automatic detection fails.

I’ve seen suggestions to create a mapping via the LensType ID, but I am unable to do so because exiv2 does not provide a LensType ID for my files. Here is the output of the metadata check:

Bash

❯ exiv2 -pv --grep lens/i DSCF4565-0007.RAF
0x1045 Fujifilm     LensModulationOptimizer     Long        1  1
0xa432 Photo        LensSpecification           Rational    4  2300/100 2300/100 140/100 140/100
0xa433 Photo        LensMake                    Ascii      13  VILTROX 
0xa434 Photo        LensModel                   Ascii      64  AF 23/1.4 XF
0xa435 Photo        LensSerialNumber            Ascii      11  00000101

My questions are:

  1. Is this an issue with darktable, Lensfun, or exiv2?
  2. How can I set up automatic lens detection when the LensType ID is missing?

Regards,
majobu

Can you share a are file?

Yeah, that mechanism is available only for Canon, Minolta, Nikon, Olympus, and Pentax cameras. It’s not because of exiv2, it’s because the camera vendor (Fujifilm) doesn’t actually store/map the lens info in that way so it could be remapped.

It’s with the complex interaction of the three.

Part of the problem could be that darktable is using only the LensModel string in these cases IIRC, while a LensMake + LensModel combo could be more useful, w/ some extra logic to avoid make duplication, prettify final output etc. Sadly lens makers and camera vendors don’t have a unified and consistent way of storing this metadata (hence all the issues).

The only realistic solution I can see to this is using Lua scripting to read the file and fill in the necessary information in the database so that the lens is recognized. I’d need an image file to work with.

1 Like

@kmilos @paperdigits @wpferguson
Thanks for the info! Do you need a JPEG or a RAW?

raw

here is a sample
DSCF4564-0006 Fotowalk - Frankfurt.RAF (55.1 MB)

1 Like

Okay, I’ve played with this for awhile and now I understand the complete problem.

The sample image does partially identify the lens as AF 23/1.4 XF.

If I look at the Exif.Photo.Maker metadata the maker is VILTROX.

So I could grab the info and put it together and have VILTROX AF 23/1.4 XF, which is correct, but doesn’t match anything in the lensfun database.

In the lensfun database the lens is identified as Viltrox AF 23/1.4 XF/Z/L.


Years ago I had an issue with Sigma lenses on Canon bodies, where Sigma had reused Canon lens numbers and so my Sigma lenses were identified as various Canon lenses.

My solution was a script, correct_lens, that basically string matched and replaced the lens string with the correct one. In this case that’s probably the best solution since the metadata included in the image still won’t result in a match with the lensfun database.

The script is ~8 years old so I’ll look at it and refresh it.