Bug 431369

Summary: Lens search uses only exact match (as I see)
Product: [Applications] digikam Reporter: Terényi, Balázs <balazs>
Component: Plugin-Editor-LensCorrectionAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: metzpinguin
Priority: NOR    
Version: 7.1.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 7.2.0
Sentry Crash Report:
Attachments: Screenshot
Screenshot with sample image from web

Description Terényi, Balázs 2021-01-09 21:19:12 UTC
Created attachment 134692 [details]
Screenshot

SUMMARY
The Lens Auto-correction editor plugin doesn't find my lens in the list automatically because it has not exactly the same name in metadata as in database. I have to select it always.

The metadata: LUMIX G VARIO 12-32/F3.5-5.6
The lensfun name: Lumix G Vario 12-32mm f/3.5-5.6 Asph. Mega OIS

The metadata comes from a Panasonic rw2 files "Lens Type" attribute.

OBSERVED RESULT
The first lens is selected in the lens selectbox.

EXPECTED RESULT
The lens most similar to the metadata should be selected. The Lens: label color may show that the match is not exact, but some more sophisticated search cloud select the most matching item in the list instead of the first one.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

See attached screenshot with the first item selected.
Thanks in advance!
Comment 1 Maik Qualmann 2021-01-09 21:23:23 UTC
Please upload a image with the lens. If not public, to my email address.

Maik
Comment 2 Maik Qualmann 2021-01-09 22:47:59 UTC
I searched the web for a sample image with the lens and cannot reproduce the problem with it. The metadata string is identical to your specification, but digiKam correctly recognizes the lens.

Maik
Comment 3 Terényi, Balázs 2021-01-10 09:08:39 UTC
I tried with one RW2 downloaded from the DPreview, and it shows the same sympthome. The workflow was:

1. Downloaded the sample RW2
2. Opened it in the editor
3. RAW imported it.
3. Selected Enchance->Auto-Correction in the editor's menu.
4. The first lens gets selected.

The same applies to out of camera JPEGS too.

My environment is:
- OpenSuSE Tumbleweed
- Everything is installed form TW packages
- Digikam 7.1.0
- Lens Auto-Correction version 7.1.0
- lensfun 0.3.2

I ran lensfun-update-data yesterday because of this problem, but doesn't helped.

If you provide the URL of the sample image, which worked for you, I would give it a try.
Comment 4 Terényi, Balázs 2021-01-10 09:10:46 UTC
KDE version info:

KDE Frameworks 5.77.0
Qt 5.15.2 (built against 5.15.2)
The xcb windowing system
Comment 5 Maik Qualmann 2021-01-10 10:00:57 UTC
The problem is not whether the lens is recognized, but whether the camera model can also be resolved by Lensfun. I can download different samples with the lens from DPreview, many can be recognized, some not - depending on the camera model. Unfortunately you have not written which camera you are using. Running "lensfun-update-data" was the right step. But we need to know if Lensfun knows your camera model.

Maik
Comment 6 Terényi, Balázs 2021-01-10 10:21:16 UTC
Lensfun knows the camera, it is matched in Digikam, the Model label is green. See screenshot attached.
Comment 7 Maik Qualmann 2021-01-10 10:45:24 UTC
I have now found this as a sample example.

https://www.dpreview.com/forums/post/61555328?image=0

It corresponds to your camera and lens. It is fully recognized. It doesn't look right with the distortion correction, but a correction has probably already been applied to the image.

Without an original sample image, we cannot reproduce the problem, find a solution and we cannot help.

Maik
Comment 8 Terényi, Balázs 2021-01-10 11:19:19 UTC
Created attachment 134706 [details]
Screenshot with sample image from web
Comment 9 Terényi, Balázs 2021-01-10 11:19:37 UTC
For me the image you linked doesn't work. The first lens in the list is selected.
See newly attached screenshot.

I sent you a sample jpeg made with the camera and lens via email.
Comment 10 Maik Qualmann 2021-01-10 11:55:58 UTC
Thanks for the sample image. Here the image is fully recognized by Lensfun. As a test, I replaced my development version with the digiKam-7.1.0 from openSUSE, but that was no problem either. Then I noticed that your screenshot says "exact match". So that means that the GUI has probably not been completely updated. I can reproduce the problem if I reduce the editor window so that the preview has to be reduced when opening the Lensfun tool. Then the wrong display occurs. So it's a GUI update problem. We will find a solution for this.

Maik
Comment 11 Maik Qualmann 2021-01-10 15:58:06 UTC
Git commit f6fa0942473126c976b1b41e42407af33f1de861 by Maik Qualmann.
Committed on 10/01/2021 at 15:55.
Pushed by mqualmann into branch 'master'.

we have to compare the original item text,
the text in the QComboBox can be shortened with (...)
FIXED-IN: 7.2.0

M  +2    -1    NEWS
M  +6    -6    core/libs/dimg/filters/lens/lensfuncameraselector.cpp
M  +20   -0    core/libs/widgets/combo/squeezedcombobox.cpp
M  +17   -8    core/libs/widgets/combo/squeezedcombobox.h

https://invent.kde.org/graphics/digikam/commit/f6fa0942473126c976b1b41e42407af33f1de861
Comment 12 Terényi, Balázs 2021-01-10 21:37:27 UTC
Thank you very much!