Project

General

Profile

Bug #11989

lensfun db updated not used by correction module

Added by Steffen Gruner about 1 year ago. Updated about 1 year ago.

Status:
Closed: invalid
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
Start date:
02/01/2018
Due date:
% Done:

0%

Estimated time:
2.00 h
Affected Version:
2.4.1
System:
Ubuntu
bitness:
64-bit
hardware architecture:
amd64/x86

Description

On my Ubuntu 16.04.3 the command lensfun-update-data stores it's updates to the directory /var/lib/lensfun-updates/version_1 like described in the man page.

For my understanding this directory should have a higher priority than /usr/share/lensfun and /usr/share/lensfun/version_1 (the version of the DB timestamp is higher, please see: http://lensfun.sourceforge.net/manual/dbsearch.html)

Darktable should search this directories (even version_2, … too) for databases and check their timestamp.

1. ~/.local/share/lensfun/updates/version_1
2. /var/lib/lensfun-updates/version_1
3. /usr/share/lensfun/version_1
4. /usr/share/lensfun

I also tried to link /var/lib/lensfun-updates/version_1 to /usr/share/lensfun/version_2 and /usr/share/lensfun/version_1 (last one was already created by ubuntu package). Only a link from /var/lib/lensfun-updates/version_1 to /usr/share/lensfun helped to see the updates in darktable.

lensfun1.png - original (33.5 KB) Steffen Gruner, 02/01/2018 06:40 PM

lensfun2.png - link created (38 KB) Steffen Gruner, 02/01/2018 06:40 PM

History

#1 Updated by Roman Lebedev about 1 year ago

  • Status changed from New to Closed: invalid

Steffen Gruner wrote:

On my Ubuntu 16.04.3 the command lensfun-update-data stores it's updates to the directory /var/lib/lensfun-updates/version_1 like described in the man page.

For my understanding this directory should have a higher priority than /usr/share/lensfun and /usr/share/lensfun/version_1 (the version of the DB timestamp is higher, please see: http://lensfun.sourceforge.net/manual/dbsearch.html)

But that is pretty much the opposite of what that page is saying:

The main place where Lensfun looks for database files usually is /usr/share/lensfun/version_x, where x is the database format version (Database format versions).

I.e. if the dt is built against old lensfun which is using db version 0, and the script updated the db for version_1, then we obviously shouldn't use it, because it is for the newer version, and it won't work (which you will see if you force it to).

#2 Updated by Steffen Gruner about 1 year ago

On my system all the .xml files are starting with db version 1:

<lensdatabase version="1">
    <mount>
    ...

I understood “Newer database” means that the file timestamp.txt, which is amongst the XML files, contains a larger value and the version tag in the .xml file is about the "compatibility". Aren't the folder versions only to hold more than one db in paralell?!

But anyway, on my system i have installed lensfun-0.3.1 (data in /usr/share/lensfun) and lensfun-0.3.2 (data in /usr/share/lensfun/version_1). The internal lensfun-0.3.2 update script "lensfun-update-data" stores the data (db version 1 too) in /var/lib/lensfun-updates/version_1. Why doesn't darktable use this update? The version and format is the same for all the folders and the updated lens information works very well for me!

#3 Updated by Steffen Gruner about 1 year ago

I fond the hint about the "Database format versions". But my system only contains lensfun versions >0.3.

I'm simply confused why the newest version stored in /var/lib/lensfun-updates/version_1 isn't used by darktable!

#4 Updated by Tobias Ellinghaus about 1 year ago

  1. Why do you have two versions of lensfun installed?
  2. Which version is used by darktable? ldd /usr/lib/darktable/plugins/liblens.so | grep lensfun might tell you.

#5 Updated by Steffen Gruner about 1 year ago

1. the two updated lensfun versions seem to be out of an ppa I have installed for digikam (https://launchpad.net/~philip5/+archive/ubuntu/extra)... don't know if I relay need them.
2. my configuration:

root@xxx:/usr/share/lensfun# ldd /usr/lib/x86_64-linux-gnu/darktable/plugins/liblens.so|grep lensfun
        liblensfun.so.0 => /usr/lib/liblensfun.so.0 (0x00007fb9987cf000)
root@xxx:/usr/share/lensfun# dpkg -S /usr/lib/liblensfun.so.0
liblensfun0: /usr/lib/liblensfun.so.0

this is lensfun version 0.3.1 out of the ppa!

#6 Updated by Tobias Ellinghaus about 1 year ago

That's what I thought. When darktable was built with the system version of the library the default lookup path was hard coded to match that. Mixing that at runtime causes all sorts of strange side effects.

#7 Updated by Steffen Gruner about 1 year ago

I can't fully agree whit that. Even the "system" version should have the option to hold multiple database instances!

If the path is hard coded in darktable you relay should think about "scanning" the different locations to find the "newest" db in the right version.

#8 Updated by Tobias Ellinghaus about 1 year ago

the number in the folder name (version_1) refers to the format of the db inside and is not meant to have several copies installed in parallel. That being said, darktable does look in different places. What exactly is going on I can't tell, but given that it's mostly due to you mixing library versions I don't think that I want to investigate that either.

Did you try running the update script as the regular user? That should copy it to your home directory, maybe there is less confusion.

#9 Updated by Roman Lebedev about 1 year ago

Steffen Gruner wrote:

I can't fully agree whit that. Even the "system" version should have the option to hold multiple database instances!

By default, when you start dt, in lens correction module, which geometry is the default (show screenshot)?

#10 Updated by Steffen Gruner about 1 year ago

@Tobias:

I tried it as root (files in /var/) and as local user (files in /home). Both locations aren't touched by darktable!

@Roman:

What do you mean exactly with "geometry" the type of the lens? I have attached two screenshots one with the oroginal setup and one with the link /var/lib/lensfun-updates/version_1 --> /usr/share/lensfun.

#11 Updated by Roman Lebedev about 1 year ago

Steffen Gruner wrote:

@Roman:

What do you mean exactly with "geometry" the type of the lens? I have attached two screenshots one with the oroginal setup and one with the link /var/lib/lensfun-updates/version_1 --> /usr/share/lensfun.

Look at the second screenshot, it says thoby-fisheye.
I'm pretty sure that lens is just normal rectangular :)
That is yet one more manifestation of just how messed up is it to mix the lensfun v0.3.x from PPA with system lensfun <v0.3.0
(They broke ABI in 0.3.0, but did not bump the soname until 0.3.1)

Two options:
1. remove PPA, downgrade lensfun. this will solve the ABI issue
2. build dt manually, this will solve ABI issue and will make it use the version_1 db that you got via the script

Other than that, the issue is still invalid i'm afraid.

#12 Updated by Roman Lebedev about 1 year ago

  • Target version changed from Candidate for next patch release to 2.6.0

#13 Updated by Steffen Gruner about 1 year ago

Hey,

in the meantime I downgraded lensfun to version 0.2.8.3 and the problem was solved!

Maybe it's a good idea to mark the dependency to <v0.3.0 in the darktable .deb package?!

Sorry for stealing your time!

#14 Updated by Tobias Ellinghaus about 1 year ago

That's up to whoever made the .deb file. It's not provided by us. Debian has lensfun 0.3.2 packaged, so chances are good that some day you will have that by default in Ubuntu, too.

Also available in: Atom PDF