How to get lensfun working for darktable

I was working on a photo taken with a Samyang 35mm on EOS 6D but when I tried to select it manually in the “lens correction” module, only 12, 14 and TS24 mm lenses showed up. But the 35mm is supported according to
It says
Samyang 35mm f/1.4 AS UMC 1.0 yes no no

I tried doing “update‑lensfun‑data” and “update‑lensfun‑database” in Terminal but it said “command not found”.

What do I need to do next or install please? (“lensfun” not found in Ubuntu Software app)

the command is

1 Like

What version of Ubuntu and what version of darktable? Are you using the snap or flatpak package?

Thanks. I installed liblensfun-bin, ran the command above without privilege, and got
a success message updating .local/share/lensfun/updates/version_1
and now there are 6 Samyang lenses shown rather than 3 before. But not the 35mm !

I should have said, I’m on Ub. 18.04.4 and dt 3.1.0~git125.05f1bf829 which I built myself. Just had a look at the log I took at the time and can’t see any odd messages in connection with lensfun.

If your lens is not in than you need to either submit some photos for it to be added or pray that someone else does it.
If it is, there is more to investigate, mosty if the files downloaded by the update command are where darktable is looking for them.

Thanks Daniel. My lens is in that link -
Samyang 35mm f/1.4 AS UMC 1.0 yes no no
I take that to mean crop factor 1 and geometric distortion is supported, but not transverse chromatic aberrations and vignetting. I’ll be happy with geometric fixing.

On the one hand, the update I did increased the lenses dt is seeing, on the other, Terminal said “Info: root privileges needed for updating the system database.” I don’t like using SUDO if I don’t really understand what I’m doing.

This whole thing doesn’t feel right comparing dt and sourceforge (SF) - the lenses dt is showing are these -
12mm f2.8 - consistent with SF - factor 1.0
14mm f2.8 - consistent with SF - factor 1.0
T-S 24mm f3.5 - consistent with SF - factor 1.0
20mm f1.8 - absent from SF!
85mm f1.4 - absent from SF!
135mm f2 - absent from SF!

I might have mislead you a bit, as Lensfun moved to github. Maybe the FAQ list will help you further: ?!? (the supported lens list seem to be the same in what Samyang is concerned)

Just have a look in the lensfun files from your drive. There should be at least one having Samyang in the name. If you find your lens there, than there is something wrong with darktable. Otherwise, maybe your lens is not in the ‘version 1’ of the DB, but only in ‘version 2’ (

@bronger, hi Torsten, are you the “bronger” involved in lensfun please? If so, how do I make my Ubuntu 18.04 and darktable setup get the latest development version of the lens data please, as per the lensfun FAQ.

I don’t know what “version 1” and “version 2” is about. I don’t know if I should be using SUDO with command “lensfun-update-data” (please see above). This all seems rather tricky, Is there an idiot’s guide please?!

You shouldn’t.


  • I don’t know if darktable uses a version-1 or version-2 lensfun DB. I think it should use vesrsion-2 (that depends on the lensfun package version of course).

  • It seems that the DB you look at is not the DB darktable looks at. lensfun-update-data should provide the location of updated DB. That could be a third location. It should be much better to be able to provide the path to the DB to be updated.

  • you have to check the DB version identified in timestamp.txt. the last timestamp I get is 1583526137. It’s a flavor of julian date.

  • Your lens 35mm f/1.4 AS UMC is in this DB as well as the other lenses in your list. There are 13 Samyang lenses identified.

  • in the github lensfun repository branch master, the DB is not up to date.

@gaaned92, thanks.

I also have this ( .local/share/lensfun/updates/version_1. There’s no version_2 folder here)
+++ CALLING DT DEVS PLS +++ How do we make dt point at this location for Lensfun please? Is there a parameter I can change somewhere before compiling for example?

version_2 might require a newer liblensfun than your system has?

lensfun.h contains this for 0.3.2:


and this for 0.3.95:


The only ‘distro’ I specifically know to be deploying a 0.3.95 lensfun package is the MSYS2 environment for Windows.

ArchLinux is on 0.3.95 as well. Because I’ve seen a few issues saying that darktable support for 0.3.95 is experimental (and breaks old edits), I’ve downgraded lensfun. Unfortunately that means the official darktable package won’t work.

0.3.2 is so old!
Regrettably, 0.3.95 doesn’t identify a unique version and I cannot identify to what hashtag the MSYS2 version corresponds. furthermore, 0.3.95 should be considered as an alpha version.
Nevertheless I build myself the master branch , waiting for a tagging in github identifying a stable version.

Perhaps that 0.3.95 and later can use some data that 0.3.2 cannot use and then improve the correction?

Ok, I’ll manage without lens corrections in dt.

? FOSS = Frequently Overcomplicates Simple Scenarios !

See and Lensfun API: 0.3.95 vs master for some context on potential issues with 0.3.95.

Freedom, otherwise software sucks.

You think commercial software isn’t overcomplicated? The difference with FOSS is you get to see how the sausages are made.

1 Like

very lovely attitude.