RawTherapee 5.8 fails to identify lenses?

I’ve been trying to get RawTherapee to apply lens corrections automatically, but it doesn’t seem to identify my lenses at all — any of them! There seems to be some kind of disconnect between the Exif data, which it reads and displays just fine, and the rest of the program. For example, I’m looking at a photo where RT is showing me Exif→LensModel = Voigtlander NOKTON 40mm F1.2 Aspherical. However… At the upper-left of the screen, where the basic file data appears, it’s showing: SONY ILCE-7RM2 + Unknown (40mm f1/2).

When I go into Profiled Lens Correction and hit “Automatically selected”, then it fills in my camera body but not the lens. I can go manual and click through the lists to find the correct profile. It’s there, it works when I select it, but I can’t automate it.

This is happening with multiple different lenses, and I have checked to make sure the names in the database match the names that are recorded in Exif.

Where am I going wrong with this?

I have done some more research and come a little closer to the root of the problem. RawTherapee is successfully identifying some lenses, and the key appears to be a metadata tag called MakerNote/LensType. If the lens name is there, RT will pick up on it.

Unfortunately, the places where my cameras store the name of the lens varies. Some of them put it in MakerNote/LensType. Some put it in Exif/LensModel. Some put it in Exif/MakerNote/LensID which often seems to contain values like “Unknown (40mm/f1.2)”.

In particular, I’m looking at a file where Exif/LensModel = Voigtlander NOKTON 40mm F1.2 Aspherical, and Exif/MakerNote/LensID = Unknown (40mm/f1.2), and RawTherapee is quite convinced that the latter tag is the one that matters for identifying a lens profile.

The lens is not supported by lensfun, so there is no way to get profiled correction. Please see: Lensfun's coverage, also for a way to get your lens supported.

The fact that RT shows ‘Unknown’ in the preview is due to imperfect metadata handling, which will most likely be solved when we switch to using exiv2. This is work in progress.