Darktable & Lensfun2

lensfun
(Cultura Difusa) #1

Hello there!

I’ve just compiled/installed from master/current lensfun (I have a Fuji XT20 + lenses that are not in my distro’s lensfun package), yet Darktable seems not to recognise the new libraries.

Any Ideas?

Thanks in advance!

(darix) #2

run lensfun-update-data

(Cultura Difusa) #3

Hello there!

I may have to look into it more deeply. It seems that lensfun-update-data binary in /usr is either the distro package (not the lensfun from master compiled by me), or if installed by “current”/“compiled” lensfun, the scripts Db web address attached to it is wrong/outdated:

Traceback (most recent call last): File "/usr/local/bin/lensfun-update-data", line 135, in <module> read_location("https://lensfun.sourceforge.net/db/

I do not want to be a pain so I will look into it and come back. But if you have any quick/dirty sugestions that would be great. From the outset, and without delving properly into it, it seems to me that either I have to uninstall the distro’s package (and leave my compiled one), or somehow let darktable know that I have a newer package. The first option is a bit convoluted, given that lensfun seems to be a dependency for Darktable (Fedora 30).

Anyway, I’ll come back if I find a solution, and post it here for “the people” to take profit.

(darix) #4

you left out the important parts of the error message

In general it works:

$ lensfun-update-data
Reading http://lensfun.sourceforge.net/db/versions.json …
Reading http://wilson.bronger.org/lensfun-db/versions.json …
Successfully updated the database in /var/lib/lensfun-updates/version_1.
(Cultura Difusa) #5

Perhaps I should uninstall the “master/compiled” version, it might be messing up with the distro’s package. I will look into it. Still, thanks for the update. Tell me what you think, if you have the time

Thanks in advance!

Reading https://lensfun.sourceforge.net/db/versions.json …
Traceback (most recent call last):
  File "/usr/lib64/python3.7/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/lib64/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/usr/lib64/python3.7/http/client.py", line 1384, in connect
    super().connect()
  File "/usr/lib64/python3.7/http/client.py", line 928, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib64/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/lib64/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/lensfun-update-data", line 135, in <module>
    read_location("https://lensfun.sourceforge.net/db/")
  File "/usr/local/bin/lensfun-update-data", line 118, in read_location
    response = urllib.request.urlopen(base_url + "versions.json")
  File "/usr/lib64/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/lib64/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.7/urllib/request.py", line 1360, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib64/python3.7/urllib/request.py", line 1319, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>```
(darix) #6

it is weird that you get a connection refused given it works for me. maybe some network configuration on your side. like a firewall.

#7

To get rid of errors, comment out the line in lensfun-update-data:
read_location(“https://lensfun.sourceforge.net/db/”)

Project Lensfun moved to Github.

(Cultura Difusa) #8

That is one of the early thoughts I had. As soon as I have time, I will try it and come back and share results.

Thanks in advance!

(Cultura Difusa) #9

Hello there!

I have fixed the issue. It is most certainly a dirty fix. Here is what I have done:

Before we begin: Darktable seems to check ONLY lensfun1 database

Point [1.2] is probably what most people want to do. As it has been pointed by darix and others.

  1. I have both lensfun packages installed (the distro package and the compilled one from master).
    1.1Probably [1] is bad idea, given that lensfun-update-data seems to work fine otherwise. Do not install from master, keep your distro package and update from command-line with lensfun-update-data
    1.2. If you try lensfun-update-data and returns an error, open the file (/usr/bin/lensfun-update-data) with a text editor and comment out/delete the sourceforge address. Then run the command again (the textfile asks to do it with “sudo/su/root privileges”).

  2. If you are masochistic like me, you have compiled the thing, have two lensfun binaries installed, and for whatever reason you want to keep booth, update lensfun1 (not lensfun2) database by hand.
    2.1 Open with a text-editor /usr/share/lensfun/version_1 (and whatever file.xml is of your interest to update (i.e. mil-fujifilm.xml). And copy from /usr/share/lensfun/version_2 whatever you want to update in version 1 of the database.
    2.2 Do the same for lenses, etc…

Can someone knowleageble tell me if what i have done is terribly wrong? -i.e. the maths from databases 1&2 are not compatible with each other, or something, and I am currently applying the wrong corrections? (I guess, they are compatible, but asking does not hurt, does it?

Thanks for all your help.

By the way… forgive my english, it is not my first language.