Bug 332314 - Lens Auto-Correction seems to prefer makernotes over Exif making fixing manual lenses impossible
Summary: Lens Auto-Correction seems to prefer makernotes over Exif making fixing manua...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-LensCorrection (show other bugs)
Version: 4.2.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-19 10:43 UTC by DrSlony
Modified: 2016-07-01 09:22 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0


Attachments
lensfun.patch (781 bytes, patch)
2015-02-13 18:31 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DrSlony 2014-03-19 10:43:28 UTC
I use a Pentax K10D with a Samyang 8mm fisheye lens. This lens is identified simply as an "A Series Lens" without focal, aperture, make or model, so I use exiftool to fix that:
http://bpaste.net/show/190750/
You will notice I included a -makernote: fix at the end of the exiftool line, but it doesn't work. Fixing the Exif is my only option.

Load an image in showFoto > Enhance > Lens > Auto-Correction
[x] Use metadata
http://i.imgur.com/C5i6j5J.png

Instead of using the Exif info, the program uses the makernotes which we cannot fix, leaving us stranded in the dirt.

Sample raw file: http://rawtherapee.com/shared/test_images/fisheye_samyang_8mm_shed.pef

Reproducible: Always
Comment 1 DrSlony 2014-09-02 16:35:47 UTC
This is still valid.

As above, I fixed the Exif http://bpaste.net/show/15fbb9331372 but:
http://i.imgur.com/H3JoUaq.png

digiKam version 4.2.0
CPU cores: 8
Demosaic GPL2 pack support: No
Demosaic GPL3 pack support: No
Exiv2 can write to Jp2: Yes
Exiv2 can write to Jpeg: Yes
Exiv2 can write to Pgf: Yes
Exiv2 can write to Png: Yes
Exiv2 can write to Tiff: Yes
Exiv2 supports XMP metadata: Yes
LibCImg: 130
LibEigen: 3.2.0
LibExiv2: 0.24
LibJPEG: 62
LibJasper: 1.900.1
LibKDE: 4.13.3
LibKExiv2: 2.3.1
LibKGeoMap: 2.0.0
LibKdcraw: 2.4.2
LibLCMS: 2060
LibLensFun: 0.2.8-0
LibPGF: 6.12.27 - external shared library
LibPNG: 1.6.12
LibQt: 4.8.5
LibRaw: 0.16.0-Beta1
LibTIFF: LIBTIFF, Version 4.0.3 Copyright (c) 1988-1996 Sam Leffler Copyright (c) 1991-1996 Silicon Graphics, Inc.
Marble Widget: 0.18.3 (stable release)
Parallelized PGF codec: No
Parallelized demosaicing: Yes
RawSpeed codec support: No
Database backend: QSQLITE
Kipi-Plugins: 4.2.0
LibKface: 3.4.0
LibKipi: 2.1.0
LibOpenCV: 2.4.9
Comment 2 DrSlony 2015-02-11 14:40:57 UTC
Bump
Comment 3 caulier.gilles 2015-02-11 14:53:12 UTC
Perhaps fixed with 4.7.0 by Maik Qualmann. I'm not sure.

Please check if reproducible with this version.

Gilles Caulier
Comment 4 Maik Qualmann 2015-02-11 18:35:40 UTC
Only the automatic detection of the lens does not work. A manual selection is possible. In the example from Comment 1 is the MakerNote "Exif.Pentax.LensType" only "A Series Lens". Unfortunately I can not find a Exif / MakerNote remark with the correct lens designation.

Maik
Comment 5 Maik Qualmann 2015-02-11 19:02:40 UTC
For the Lens Model "Samyang 8mm f / 3.5 Fish-Eye CS" is in lensfun-0.2.8 no data available.

Maik
Comment 6 DrSlony 2015-02-12 13:53:19 UTC
lensfun-0.3.0 is the version we care about, and it does have data for the Samyang 8mm
Comment 7 DrSlony 2015-02-12 14:19:18 UTC
Test in 4.7.0.

Now updating makernotes works, maybe the exiftool update is responsible for that, I'm using version 9.82 now.
exiftool -P -overwrite_original_in_place -FocalLength="8.0" -FocalLengthIn35mmFormat="14" -ApertureValue="11.0" -FNumber="11.0" -LensModel="Samyang 8mm f/3.5 Fish-Eye CS" -LensMake="Samyang" -LensInfo="8.0 8.0 3.5 22.0" -MakerNotes:LensType="Samyang 8mm f/3.5 Fish-Eye CS" -MakerNotes:FocalLength="8.0" fisheye_samyang_8mm_shed.pef

I can apply the lens correction manually, yay!
http://i.imgur.com/9suDPKV.jpg
But, as stated by Maik, automatic does not work.

Bug 1:
The raw contains Make:PENTAX Corporation
showFoto's make drop-down list has "Pentax Corporation", with the word PENTAX not in capitals as the camera writes, therefore the match fails.

Bug 2:
The raw contains Camera Model Name:PENTAX K10D
showFoto when I select Make:Pentax Corporation has the camera model as "Pentax K10D", again not using the original file's capitalization, therefore the match fails.

Bug 3:
The match for the lens also fails, even though the list does contain my lens with the exact same spelling and capitalization as far as I can tell.
Comment 8 Maik Qualmann 2015-02-13 18:31:09 UTC
Created attachment 91058 [details]
lensfun.patch

I have lensfun-0.3.0 installed manually, for openSUSE there are no packets.
The search of make was already in digiKam 4.7.0 without case-sensitive.
This patch makes the search for the model without case-sensitive, lensfun-0.3.0 requires it.
Now work the automatic search for the lens.
Comment 9 DrSlony 2015-02-13 19:02:02 UTC
I can't test patches but I look forward to seeing this in 4.8.0, thank you!
Comment 10 caulier.gilles 2015-02-14 13:23:03 UTC
Git commit b7cbe483787fbde5a76cee8ad46cc0208356d0bb by Gilles Caulier.
Committed on 14/02/2015 at 13:20.
Pushed by cgilles into branch 'master'.

Apply patch #91058 from Maik Qualmann to fix string comparison while camera info search in metadata for Lensfun interface
FIXED-IN: 4.8.0

M  +2    -2    libs/dimg/filters/lens/lensfuniface.cpp

http://commits.kde.org/digikam/b7cbe483787fbde5a76cee8ad46cc0208356d0bb
Comment 11 caulier.gilles 2015-02-14 13:30:12 UTC
Git commit 5da6feb370c2875ac7472c02549c97e913d9281d by Gilles Caulier.
Committed on 14/02/2015 at 13:28.
Pushed by cgilles into branch 'frameworks'.

backport commit #b7cbe483787fbde5a76cee8ad46cc0208356d0bb from git/master to frameworks branch

M  +1    -1    libs/dimg/filters/lens/lensfuniface.cpp

http://commits.kde.org/digikam/5da6feb370c2875ac7472c02549c97e913d9281d
Comment 12 Stefan Brüns 2015-02-25 15:33:57 UTC
(In reply to Maik Qualmann from comment #8)
> Created attachment 91058 [details]
> lensfun.patch
> 
> I have lensfun-0.3.0 installed manually, for openSUSE there are no packets.
> The search of make was already in digiKam 4.7.0 without case-sensitive.
> This patch makes the search for the model without case-sensitive,
> lensfun-0.3.0 requires it.
> Now work the automatic search for the lens.

lensfun is 0.3 has been commited to the openSUSE graphics repository, and it it has been pushed to the KDE:Extra repository and Factory/Tumbleweed. It may take some more hours until the compiled package is available in KDE:Extra and Factory.
Comment 13 Maik Qualmann 2015-02-25 18:17:20 UTC
(In reply to Stefan Brüns from comment #12)
> lensfun is 0.3 has been commited to the openSUSE graphics repository...

Thanks for the hint. Is now also listed under http://software.opensuse.org/. Had recently used the Fedora packages.

Maik