Lensfun - getting it to work with darktable

I have downloaded/installed lensfun via the terminal. However, when in darktable I click on the lens corrections module, no lens is detected. What am I doing wrong?

Thanks.

Caruso

1 Like

Which OS, which dt version ?
If you click on the “lens” button (second from above) : does the menu of lens manufacturers show up? Is your lens in the list of supported lenses (Lensfun)? The name of your lens (image information) must exactly (every single character) match the name of the lens in the list to be detected automatically by the lens correction module.

Thanks for the reply. I am running Ubuntu 20.01.1 LTS. When I click on the lens correction module, my camera model shows, followed by the lens manufacturer, that it is AF, and the focal length and aperture range (all correct). Then on the next line a message that camera/lens not found - please select manually. If I click on the “lens” button, nothing happens, no drop down (which I would have expected).

Caruso

Which version of dt are you using? The latest version is 3.2.1.
A camera manufacturer named “AF” does not exist in the list of supported manufacturers. What happens if you select the “manufacturer” button (the field with the manufacturers name, not the small triangle right of it). And as @paperdigits just posted : updating the lensfun database could help.

In a terminal, run sudo lensfun-update-data

Edit: data, not db

sudo lensfun-update-data *

Yes, this is the command to update the lensfun database : lensfun: Updating Lensfun's database: lensfun‑update-data
What about manufacturer “AF” ? As far as I can see lensfun does not support “AF”.

@pehar Caruso did not say that ‘AF’ is the manufacturer, “followed by the lens manufacturer , that it is AF, and the focal length and aperture range (all correct)”, so it is an autofocus lens.

@carusoswi Can you maybe share a raw file that has this issue?

I believe all my raw files will behave in DT similarly. Here is a sample file (not much of a photo, but it will do: Dropbox - DSC00675.ARW - Simplify your life

Will run the suggested commands.

Thanks to all for your suggestions.

Caruso

FYI, when I run these commands, the terminal returns ‘command not found’.

Not certain why.

Caruso

“Command not found” means that the command you typed isn’t available to you.
There can be several reasons, usually it means you neglected to install the proper package.

As you didn’t give the full error message, I’ll have to guess a bit.
If you didn’t get a prompt for the root password, you might be missing “sudo”,
if you did get that prompt, you are missing one of the lensfun packages.
As I’m not using ubuntu, I don’t know the exact names of the packages, for openSuse 15.1 the lensfun packages are:

  • liblensfun1 : hte lensfun library files
  • lensfun-data : the data files
  • lensfun-tools : extra tools, this is the package that contains lensfun-update-data

There are a few more, python3-lensfun (to call lensfun from python) and lensfun-doc
Perhaps you just forgot to install the data and tools packages? I’m not quite clear about how you installed the lensfun library, tbh.

More precisely, ‘lensfun-update-data’ isn’t in any of the paths in your PATH variable. Try looking for it with:

$ locate lensfun-update-data

If you find it, you’ll either need to include that path in PATH, or move lensfun-update-data to a PATH path. You can see a list of PATH’s paths by entering:

$ echo $PATH

Welcome to unix… :scream:

2 Likes

Downloaded your image, works for me as expected :
lensfun
Clicking on the “lens” button the menu appears. You will have to check your lensfun installation.
The name of the lens, extracted from exif metadata, is

[MakerNotes] 0xb027 Lens Type : Minolta AF 100-300mm F4.5-5.6 APO (D) or Sigma Lens

I think a further problem could be the addendum “or Sigma Lens

Update:
on Ubuntu 20.04 you will find the tool “lensfun-update-data” in package “liblensfun-bin” (Ubuntu – File list of package liblensfun-bin/focal/all). You can check if “liblensfun-bin” is installed by the command

apt-cache policy liblensfun-bin

The complete “lensfun-family” consists of 6 packages :

The above command returns:

liblensfun-bin:
Installed: (none)
Candidate: 0.3.2-5build1
Version table:
0.3.2-5build1 500
500 Index of /ubuntu focal/universe amd64 Packages

Additionally, the screenshot you show in your post is identical to the results I get and the description of those results that I posted, so, if that is normal, why does it show camera/lens not found - please select manually? If I choose to select manually, where would I make that selection?

If this is how it is supposed to work, where can I make corrections? I must be missing the whole point.

Please advise further, and thanks for the reply.

Caruso

This means that lensfun-update-data is not available because the package liblensfun-bin is not installed

This means that the package is available in Ubuntu repository. To install the package you can use

sudo apt install liblensfun-bin

Of course, because I used the same image. The text strings “Sony, Alpha 900” and “Minolta AF 100-300mm…” are extracted from the exif metadata of your image file. The note “camera/lens not found - please select manually” tells you, that darktable/lensfun is not able to identify a lens from the lensfun database matching the MakerNote “LensType” I posted in my recent post. As said, this may be due to the addendum “or Sigma Lens”. Matching means matching every single character.

Click on the lens name “Minolta AF 100-300mm…”, select the lens of your choice from the appearing menu. If the menu does not appear your lensfun installation might be faulty or incomplete. To check if the packages are available you can use the commands

apt-cache policy liblensfun1
apt-cache policy liblensfun-data-v1

Missing packages can be installed by

sudo apt install "package-name"

I’m not abolutely sure, but as far as I remember you will need at least liblensfun1, liblensfun-data-v1, and if you need the update tool additionally liblensfun-bin.

1 Like

Followed all your suggestions. All the packages your recommended are present on my system. Still, when I drop down the lens selection menu, a brief list of lens manufacturers appears, but nothing mentioning Minolta (or Sony for that matter). I could see the lack of Minolta since they are not around, but Sony should be there. I must be doing something wrong still. I’ve searched for tutorials, but have found none so far.
Thanks again for hanging in with me and continuing to provide advice.
Caruso

The manual says :

Only lenses with correction profiles matching the selected camera will be shown.

Are you, by chance, using the snap package?

I am.
Caruso

You can’t update lensfun inside the Snape and it won’t use your system’s lensfun library. Thus is a known issue.

The flatpak already has this solved, as it pulls the latest lens profiles at build time.