RawTherapee doesn't detect lens type automatically

I have some trouble with Raw Therapee detecting the correct lens type on Fedora Linux. It worked pretty well for years and some months ago it stopped working. I was hoping for an update to fix the problem, but it didn’t, so I guess I have to fix something on my own but don’t know where?
Instead of showing the lens type mounted on the camera while taking the photo it shows “unknown” in the information box on the top left side of the image and an empty selection box in lensfun section, the camera model is shown correctly. I have read several threads about similar problems, where there was a problem with the lensfun database and no lenses could be selected. But in my case the problem isn’t that there is no database, it’s all there: I can select whatever lens I want, …manually. But it lacks automatic detection of the lens. I also tried other software like Darktable and DigiKam which detect the lens type correctly, so it just doesn’t work with RawTherapee. Can anyone help finding a solution?
Fedora 31 with latest updates; RawTherapee 5.8-2; Lensfun 0.3.2-22

Edit: Actually read this thread: RawTherapee 5.8 not recognising lens correctly and think my issue is somehow related to what is described there. In my case the lens is also shown correctly in RTs file manager, but only for images which we’re already loaded in RT before this error occurred, all newly added images (taken with the same lenses) show up as unknown. At least installing the latest Windows build like suggested in this thread won’t do the trick running on linux and 5.8 is the latest version.

What version of exiv2 is installed on your system? Can you use exiv2 at the CLI to dump the file’s metadata?

1 Like

Thank you for your reply. Exiv2 version is 0.27.2-1 and I did “exiv2 pr” in terminal which shows metadata of the file, but no lens model, with -pv option I also see the lens model.

Do I understand correctly that you are using the RT package from the Fedora repositories, and not the AppImage?
Could you share a sample RAW image taken with the unrecognized lens?

1 Like

You’re right, I’m using the version from fedora repo. Because of your comment I thought the appimage could be worth a try and downloaded it, but there’s no change, lenses are not recognized. Starting the appimage it also uses my settings from the repo version is that right? I also tried to reset settings by moving ~/.config/RawTherapee to anywhere else, and even with clean settings it didn’t work so I suggest my settings are not the reason for this issue.
Here’s a sample image taken with the Sony E35mm, which is in lensfun database, so it should be recognized. Not an artwork at all, it was just for a lens test.
DSC00544.ARW (24.0 MB)

It also affects other lenses: Sony FE50mm and the 16-50mm kit lens.

1 Like

Thanks! I will have a look with the AppImage later in the evening…

1 Like

Ok, it seems to be a problem with RawTherapee 5.8, just like in the other thread I linked above. I did a “dnf downgrade rawtherapee” today and it worked fine with 5.7. The correct lens shows up in the info box on the top left and choosing lensfun profile automatically works fine. Just the metadata filter in RTs file manager won’t work for some folders I visited recently, but I suggest there’s some kind of cache which has to be deleted or rebuilt in order to update this information.
Ok, so I could at least downgrade to 5.7 and wait for a fix in the next release or use 5.8 and apply profile manually. Carmelo_DrRaw did it work on your system? If it doesn’t, maybe I should file a bug report in Github so it could be fixed in further versions.

I solve these kind of problems with dynamic profiles http://rawpedia.rawtherapee.com/Dynamic_processing_profiles

1 Like

This could be a workaround too, it won’t work when I add the correct lens name, but “unknown 35mm” or similar should work too. Also possible for prime lenses: I could create profiles for the focal length of the lens.

I did a test with the official appimages - both the 5.8 release and the current dev branch - and in both cases the lens is not found. Something must have changed in the way RT parses the EXIF data… @Morgan_Hardwood @heckflosse any idea?

1 Like

I just started bisecting…


It’s this commit:



Sorry, but what does that mean? When I’m right the link shows a diff output, which tells that nearly all Sony or Sony compatible lenses we’re removed from this file, compared to an older version. But why? Can anyone explain it to me?

I’m not an RT dev but as I understand it, it looks like most of the Sony related lens definitions where inadvertently removed when the library that provides the lens identification function was updated. I would guess this means that the definitions can be added back without too much trouble in the next version of RT.

Please let me know if I’ve misunderstood.

Thank you for your explanation, I suggest since you’re no RT dev, you are just as clueless as me, why they we’re removed? Is it a bug or is there a reason to remove them?
And what does it mean that this issue is closed in GitHub? Does this mean this error will be fixed in the next release?