How change to the deveopment version of Lensfun

DT use Lensfun for storing lens characteristics. The current version i 0.3.2 and is missing three of my most used lenses. However the development version of Lensfun are complete with those three. Is there a simple way to use the development version instead of the one included in DT 3.7 soon to be 3.8?

As there is no lensfun-update-data tool on Windows (unless you have installed your own MSYS2 MINGW4 development environment and the mingw-w64-x86_64-lensfun package), you can add your lenses manually from lensfun/data/db at master · lensfun/lensfun · GitHub to your C:\Program Files\darktable\share\lensfun\version_1\ database.

Searching the forum also helps before posting, as there are other workarounds for this frequently asked question:

Thank you for your reply. I copied the contents of canon-slr.xml from github to my local file. I can see the missing lenses in it now… but still in the Lens correction module it does not show up…

@ggbutcher developped a small program to update lensfun db for bundled W10 apps.
I use it for my Art and Rt windows builds.
It could be a good idea to integrate it directly inthe apps.

Sorry, maybe I should have been a bit more explicit: just copy the lens you need (i.e. the <lens>...</lens> section), as the the actual entire file differs somewhat between stable and development versions…

If you copied the entire file, just remove the first line (<!DOCTYPE...) and make sure the version is 1 as in <lensdatabase version="1"> at the top now.

2 Likes

It’s here:

https://github.com/butcherg/lensfun_dbupdate

There’s one release posted, a .zip file that contains a windows executable of dbupdate. Run the .exe from a windows command line without parameters, and it’ll spit out a short Usage thing…

2 Likes

did you ever consider upstreaming this to lensfun so they could ship this as part of their package?

You are not advised to use the development version of lensfun (or version 0.3.95, which is not an official release) due to incompatibilities between the versions. See https://github.com/darktable-org/darktable/issues/2813 for details. Until this is resolved you are advised to stick to lensfun 0.3.2 and use the update facility to add lenses.

I started this as a library to incorporate in rawproc, present as of commit 8f01ae. dbupdate was just a test program to exercise the library, not at all user-friendly. My preference would be for the other raw processors to incorporate the library, with associated dialog/menu invocation per their UI structure…

@elstoc’s approach is preferable, IMHO. i don’t remember the specifics of version_1/2 differences, but copying the version_2 file into a version_1 database may mess up other cameras…

While the lensfun code seems to be in limbo, the database is actively maintained, with both current version_1 and version_2 available through their lensfun_dbupdate - accessed repository. This is the best way to keep the proper version updated.

1 Like

TBH not sure why each and every program should be responsible to pull lensfun data. a simple GUI app that shows the version of lensfun data files one has locally vs the one available with a button to download things would be way more appropriate that every photo editor getting a lensfun update button.

1 Like

I think that is because that’s where the user expects it to be. I know we have a zillion libraries and all that, but the user thinks “dt/rt/et al. have the lens profiles” so why not just update it from there?

I got to thinking this way considering the other configuration files I use, particularly camconst.json. I haven’t incorporated it yet, but my “update data” menu item will eventually include it.

It’s not always obvious or straightforward to determine what database/configuration file is being used in a program. Depending on what’s on a user’s system, it could be getting lensfun data from a .home directory, or a distro directory, …

In rawproc, the About box shows both rawproc.conf and the lensfun database, and for lensfun it tells whether the database is current to the posted copy at the repo.

I have, if you also want, created

EF 24-105/4L IS USM (improved TCA)
EF 24/1.4L II USM
EF 50/1.0L USM (test)
EF 50/1.2L USM
EF 300mm 2.8L IS USM

Sigma 500mm f/4.5 APO EX DG HSM