Bug 343080 - Cannot find the right lensfun profile for RAW lens correction [patch]
Summary: Cannot find the right lensfun profile for RAW lens correction [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-LensCorrection (show other bugs)
Version: 4.6.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-20 14:20 UTC by C. Priisholm
Modified: 2016-07-01 09:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.0


Attachments
lensfun.patch (3.90 KB, patch)
2015-01-21 18:56 UTC, Maik Qualmann
Details
attachment-5822-0.html (2.11 KB, text/html)
2015-01-27 16:57 UTC, C. Priisholm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description C. Priisholm 2015-01-20 14:20:29 UTC
I have a Sony Alpha 5000 (SONY ILCE-5000) but it defaults to some Sony compact camera when I go to use the automatic correction tool.
That is partly because the camera is not included in the lensfun db until version 0.3.
I did patch relevant info from newest release into the /usr/share/lensfun/mil-sony.xml (openSUSE Tumbleweed).
It was then possible to select the correct camera model in the automatic correction tool, but the Lens-selector kept showing some lenses from the list of compact-sony.xml.
I then removed the compact-sony.xml and restarted digiKam, now it is possible to select correct camera model and the correct lens.

Reproducible: Always

Steps to Reproduce:
1. Patch the /usr/share/lensfun/mil-sony.xml with the SONY ILCE-5000 information from the latest version of lensfun (0.3.0 as of time of writing this)
2. Open raw file (ARW) in image editor and import
3. Choose automatic correction from the tool selection.
4. Select Sony and ILCE-5000 (manuel selection needed, see comment below)

Actual Results:  
The Lens-selector shows some lenses seemingly coming from the list of compact Sonys (compact-sony.xml).

Expected Results:  
The Lens-selector should show the relevant E mount lenses from mil-sony.xml (and ditto sigma and tamron files)

It seems that the files are mostly the same though naming of lenses has been changed slightly from 0.2.8 to 0.3.0 so the may be an issue. But on the other hand, UFRaw can load the information even before I remove the compact-sony.xml which somehow seems to confuse something in case of digiKam.

A change from 0.2.8 to 0.3.0 (at least for Sony) is that the name is now "Sony" rather than "SONY". Digikam makes a distinction so there is now two entries for sony in the list of vendors (but that probably goes away once all lensfun files are version 0.3.0, but at least digikam should not be case-sensitive when trying to match camera meta data to lensfun database)
Comment 1 caulier.gilles 2015-01-20 14:29:56 UTC
Maik,

If you is interrested by this entry, it's a junior job report...

Code relevant in digiKam Lensfun interface is located here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/dimg/filters/lens/lensfuniface.cpp#L210

There is a CLI program dedicated to check digiKam LensFun interface with images :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/tests/testlensfuniface.cpp

This one will print parser results on the console.

Gilles Caulier
Comment 2 caulier.gilles 2015-01-20 14:31:01 UTC
Claus,

We need test images to hack. Please shares files somewhere in a public cloud.

Thanks in advance

Gilles Caulier
Comment 3 C. Priisholm 2015-01-20 15:05:38 UTC
Should I attach a zip with a couple images + the xml-file (37MB) or is it better to put it somewhere so you can download it?
Comment 4 caulier.gilles 2015-01-20 15:07:44 UTC
Buzilla is limited to 1Mb attachement...
Comment 5 C. Priisholm 2015-01-20 15:41:38 UTC
Ok, I have put the zip file here: http://www.codedroids.dk/pub/digikam-lensfun.zip

Let me know if you need anything else.
Comment 6 Maik Qualmann 2015-01-20 22:08:54 UTC
Thanks for the ZIP file. I have created a hack that already works. I can see in the EXIF / Makernote no object distance. You know, in this model the corresponding EXIF / Makernote?

Maik
Comment 7 C. Priisholm 2015-01-21 17:52:34 UTC
Hi Maik 

Sounds great.

 I don't have the camera with med so I'll check the meta data stuff next week

The files were not taken directly from the memory card but rather after they've been imported by digikam but that should not remove any meta data afaik.
Comment 8 Maik Qualmann 2015-01-21 18:56:39 UTC
Created attachment 90566 [details]
lensfun.patch

The search of camera from metadata is now case insensitive.
A Sony camera model (DSC-RX100) required this already in lensfun-0.2.8.
Manual selection now works, the lenses list was previously not updated after model selection.
Search for camera, model and lens from metadata could fail, because of not blocked signals.
New Sony lenses EXIF tag added to dmetadate.cpp. Object distance will be added when it should exist in the EXIF.
Comment 9 caulier.gilles 2015-01-22 10:34:38 UTC
Git commit 112108ad8fbcfa61d12dbe678c2f69c70bbd4923 by Gilles Caulier.
Committed on 22/01/2015 at 10:32.
Pushed by cgilles into branch 'master'.

Apply patch #90566 from Maik Qualmann to make case sensitive search of camera name in metadata for lensfun image editor tool.
FIXED-IN: 4.7.0

M  +2    -1    NEWS
M  +16   -1    libs/dimg/filters/lens/lensfuncameraselector.cpp
M  +1    -0    libs/dimg/filters/lens/lensfuncameraselector.h
M  +1    -1    libs/dimg/filters/lens/lensfuniface.cpp
M  +1    -0    libs/dmetadata/dmetadata.cpp

http://commits.kde.org/digikam/112108ad8fbcfa61d12dbe678c2f69c70bbd4923
Comment 10 caulier.gilles 2015-01-22 11:19:09 UTC
Git commit fbae1beb84e42574571ccca91accd6186fbc02fe by Gilles Caulier.
Committed on 22/01/2015 at 11:13.
Pushed by cgilles into branch 'frameworks'.

backport commit #112108ad8fbcfa61d12dbe678c2f69c70bbd4923 from git/master to frameworks branch

M  +22   -1    libs/dimg/filters/lens/lensfuncameraselector.cpp
M  +1    -0    libs/dimg/filters/lens/lensfuncameraselector.h
M  +2    -2    libs/dimg/filters/lens/lensfuniface.cpp
M  +4    -2    libs/dmetadata/dmetadata.cpp
M  +1    -4    libs/dmetadata/dmetadata.h

http://commits.kde.org/digikam/fbae1beb84e42574571ccca91accd6186fbc02fe
Comment 11 C. Priisholm 2015-01-27 16:57:40 UTC
Created attachment 90704 [details]
attachment-5822-0.html

Hi Maik

I've been trying to find object distance (or subject distance) for the Sony
alpha 5000 with no luck. My googling turned op a comment in the code for
exiv2 but that refers to is as a Minolta something (Sony bought Minolta so
that is probably why), but exiv2 cmd line util does not find the info
either.

I have tested with sonys own playmemories application for windows and that
does not show the distance info either. So either they do not record that
information, or else it is burried somewhere in the makernote that even
sony don't know about :-)

This (not entirely new thread, talking about previous generation of alphas)
seem to suggest that it is not set (even if subject distance is a part of
EXIF):
http://www.dyxum.com/dforum/focus-distance-in-exif_topic73942_page2.html

Brs
Claus

PS. great work - seems you spotted another bug related to the lens list not
updating - I though that it had to be manually set...

2015-01-20 23:08 GMT+01:00 Maik Qualmann <metzpinguin@gmail.com>:

> https://bugs.kde.org/show_bug.cgi?id=343080
>
> --- Comment #6 from Maik Qualmann <metzpinguin@gmail.com> ---
> Thanks for the ZIP file. I have created a hack that already works. I can
> see in
> the EXIF / Makernote no object distance. You know, in this model the
> corresponding EXIF / Makernote?
>
> Maik
>
> --
> You are receiving this mail because:
> You reported the bug.
>