Updating Lensfun profile for NIKKOR Z 24-120mm f/4 S lens and possibly others

I bought NIKKOR Z 24-120mm f/4 S this summer and I’ve been missing lensfun profile since then. Fortunately few weeks ago some good soul (tuxfanx) has merged profile for this lens in master branch of GitHub Lensfun repository.
I haven’t found guide how to update Lensfun profiles in Darktable for Windows, so here is my 2c if someone would like to know how I did it.

  • Check this lensfun folder for xml file with lens profile you need
    lensfun/data/db at master · lensfun/lensfun · GitHub
    (Nikon Z lenses are in mil-nikon.xml)
  • Download lensfun files
  • open xml file you want to use and set version to 1 (lensdatabase version=“1”)
    (On github is version=2 in xml file. It didn’t work. I’ve compared v1 and v2 files and found no differences in nikon-mil file other than that so I just manually replaced 2 with 1)
  • open darktable folder where lens profiles are located (on my computer C:\Program Files\darktable\share\lensfun\version_1)
  • backup your xml file so in case something go wrong you can revert
  • copy new xml into lensfun profile folder
    This works for me, hopefully could work for others too.

I’m very happy with Z 24-120 lens except it has really nasty distorsions on extreem focal lenghts so lens correction is almost always necessary.

Thank you tuxfanx for your effort of creating and publishing profile for this lens.

Seems you’re on windows if that isn’t obvious to others.

2 Likes

@paperdigits Good point. I’ll add that to the post. Thanks

See also How To Keep Lensfun Current on Windows 10?

There’s been several similar topics, this comes up frequently… :disappointed:

Good. I have this lens on order.
I’m on linux. I looked for it in lensfun at the weekend on my machine. Not there. And update attempt failed as the url wasn’t responding. Hopefully that will be sorted soon.

Also, keep in mind this does not work in general if there is a more complicated correction profile present, the script/utility is preferred.

1 Like

And lo and behold, today it’s there, and I have the new lens profile.
Now if only the lens will arrive before Christmas…