Project

General

Profile

Bug #10284

Leica DG Summilux 15mm f/1.7 lens is no longer displayed in DTs image information (left side of lighttable) - just some numbers appear

Added by Michael Born over 5 years ago. Updated over 4 years ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
General
Target version:
-
Start date:
01/13/2015
Due date:
% Done:

100%

Estimated time:
Affected Version:
git stable branch
System:
openSUSE
bitness:
64-bit
hardware architecture:
amd64/x86

Description

I'm on the git branch darktable-1.6.x
Some days ago I realized that the Leica DG Summilux 15mm f/1.7 lens is not
any longer displayed in DTs image information (left side of lighttable; Olympus E-M10 camera; Olympus ORF raw file).
Instead, some numbers appear.
I thought, it's my lensfun installation (had version 0.2.9, now switched
to 0.3.0) but it is the following commit. After reverting it and
reimporting the images, the lens name is displayed again.
An Olympus 45mm f1.8 lens was not affected.

Reverting commit 0b81e29be3d23ba10dc94c66db2d1be2cd7cc58a fixes the problem for me.

I'm on OpenSUSE 13.1 64bit

example.png (2.11 MB) example.png Working under current stable Ubuntu Jan Niklas Fingerle, 01/17/2015 02:07 AM

Related issues

Related to darktable - Bug #10239: Olympus lenses not recognized for lensfun functionalityFixed12/18/2014

Related to darktable - Bug #10411: Lens not recognized by "lens correction" moduleDuplicate04/08/2015

Associated revisions

Revision bfc6be98
Added by Pascal de Bruijn about 5 years ago

Merge pull request #895 from jnfingerle/bug-10284

Fix Bug #10284

Revision 5eddf5c2 (diff)
Added by Jan Niklas Fingerle about 5 years ago

Fix Bug #10284

(cherry picked from commit e0007857abede964fff6dd7291547b332027373c)

History

#1 Updated by Michael Born over 5 years ago

1. The problem also is in git master (not only the 1.6.x branch)

2. Here is a test file for download: https://mega.co.nz/#F!XhMz3TyJ!_sMnDfdMko0xNlqT-kvs_w
(I hope, this works)

Look at the "image information" "lens" field:
http://abload.de/image.php?img=dt_leica_detectionpbs7c.png

#2 Updated by Roman Lebedev over 5 years ago

  • Related to Bug #10239: Olympus lenses not recognized for lensfun functionality added

#3 Updated by Jan Niklas Fingerle over 5 years ago

As shown in the attached picture, it works with the current stable ubuntu packages (under Mint which uses the last Ubuntu LTS as base). Look for "Objektiv", since it's a german install.

I strongly suspect that this is an issue with the exiv2 version which is responsible for translating those numbers into human readable strings.

If this is true, reverting said commit wouldn't fix it for real (since updating to a newer lensfun would re-introduce the problem). Instead the deleted version checks on lensfun from said commit would have to be replaced by a version check for the correct exiv2 version.

So much from what i gathered from looking on the code and trying it out locally. HTH

#4 Updated by Michael Born over 5 years ago

Interesting.

michael@musashi:~/darktable> ldd /opt/darktable/bin/darktable |grep exiv
        libexiv2.so.13 => /usr/lib64/libexiv2.so.13 (0x00007fc299d15000)
michael@musashi:~/darktable> ll /usr/lib64/libexiv2.so.13
lrwxrwxrwx 1 root root 18 20. Jul 15:06 /usr/lib64/libexiv2.so.13 -> libexiv2.so.13.0.0

The OpenSUSE software management (yast) says this is version 0.24-5.1

michael@musashi:~/bilder/20150100_Januar/darktable_exported> exiv2 -V
exiv2 0.24 001800 (64 bit build)

Listing lens information with the exiv2 tool gives

michael@musashi:~/bilder/20150100_Januar/darktable_exported> exiv2 -Pnt P1091024.jpg |grep Lens
LensType                     2 0 34 16 0 16
LensSerialNumber             04EIC068005N
LensModel                    LEICA DG SUMMILUX 15/F1.7 
LensFirmwareVersion          4096
LensProperties               16768
ConversionLens               
LensSpecification            15/1 15/1 17/10 17/10
LensModel                    LEICA DG SUMMILUX 15/F1.7 

So, my installed exiv2 version gives the real name in the field "LensModel" and just numbers in the field "LensType". This is what I see then in darktables image information. And, therefore, the commit breaks it for me because it switches from using the "LensModel" field to the (for me broken) "LensType" field.

Is my exiv2 so outdated? My OpenSUSE 13.1 is not brand new, but not very old either...

#5 Updated by Michael Born over 5 years ago

@Jan Niklas Fingerle: What exiv2 version do you use?

It seems, the latest official version is 0.24 from 02-Dec-2013 ( http://www.exiv2.org/download.html )
So, the Linux distributions seem to ship 0.24 with some patches... OpenSUSE seems to have a 0.24 from Mon Apr 14 18:32:06 UTC 2014.
But only svn revision 3263 from 17 Jun 2014 06:37 seems to have the Lens support (Add new lens: Leica DG Summilux 15mm F1.7 Asph. for Olympus m43.)

#6 Updated by Jan Niklas Fingerle over 5 years ago

jnf@agricola ~ $ which darktable
/usr/bin/darktable
jnf@agricola ~ $ ldd /usr/bin/darktable |grep exiv
    libexiv2.so.12 => /usr/lib/libexiv2.so.12 (0x00007fe6b735a000)
jnf@agricola ~ $ ll /usr/lib/libexiv2.so.12
lrwxrwxrwx 1 root root 18 Dez  8 13:58 /usr/lib/libexiv2.so.12 -> libexiv2.so.12.0.0
jnf@agricola ~ $ apt-show-versions exiv2
exiv2:amd64/trusty 0.23-1ubuntu2pmjdebruijn6~trusty uptodate
jnf@agricola ~ $ exiv2 -V
exiv2 0.23 001700 (64 bit build)
[...]
jnf@agricola ~ $ exiv2 -pt path/to/image.ORF | grep -i lens
Exif.OlympusEq.LensType                      Byte        6  Leica DG Summilux 15mm F1.7 Asph.
Exif.OlympusEq.LensSerialNumber              Ascii      32  04EIC068005N
Exif.OlympusEq.LensModel                     Ascii      32  LEICA DG SUMMILUX 15/F1.7 
Exif.OlympusEq.LensFirmwareVersion           Long        1  4096
Exif.OlympusEq.LensProperties                Short       1  16768
Exif.OlympusEq.ConversionLens                Ascii      32  
Exif.Photo.LensSpecification                 Rational    4  15/1 15/1 17/10 17/10
Exif.Photo.LensModel                         Ascii      32  LEICA DG SUMMILUX 15/F1.7 

I think, the interesting part here is the pmjdebruijn in the package version, see https://launchpad.net/~pmjdebruijn/+archive/ubuntu/darktable-release - I think that Pascal backported something (the lens db?) into the older version (number).

Just to repeat an example for Olympus Four Thirds (no micro):

exiv2 -pt path/to/image.ORF | grep -i lens
Exif.OlympusEq.LensType                      Byte        6  Olympus Zuiko Digital ED 14-42mm F3.5-5.6
Exif.OlympusEq.LensSerialNumber              Ascii      32  212686538
Exif.OlympusEq.LensModel                     Ascii      32  OLYMPUS 14-42mm Lens
Exif.OlympusEq.LensFirmwareVersion           Long        1  4869
Exif.OlympusEq.LensProperties                Short       1  49223

... Exif.Photo.LensModel is missing and Exif.OlympusEq.LensModel is missing information that leads to collisions between existing lenses. Maybe one should use Exif.OlympusEq.LensType if available and containing more than digits and whitespace with fallback if that's not the case?

#7 Updated by Pascal de Bruijn over 5 years ago

So my Exiv2 package for Ubuntu Trusty is Exiv2 0.23 + many many patches. This makes my package (for Darktable's uses) closer to the not yet released Exiv2 0.25 (except for the video file nonsense). I'm only cherry-picking Exiv2 patches that are general bug fixes, MakerNote and lens detection related. So all the goodies without much of the risks of a major new release. Practically speaking it's way ahead of what any general purpose distro would provide.

The current behavior is basically right. Exif.OlympusEq.LensType should probably be preferred, as the vendor's own Exif.OlympusEq.LensModel tends to be not too reliable, and might even be missing on older bodies.

That said, if LensType is not present, a fallback to LensModel might be in order.

The problem then is coming up with a sensible heuristic. My first thought would be if LensType doesn't contain any alphabetic characters then fall back to LensModel.

#8 Updated by Jan Niklas Fingerle over 5 years ago

"if LensType doesn't contain any alphabetic characters then fall back to LensModel" is what i meant above. If exiv2 doesn't know the lens it gives the numeric values of that field instead, on the other hand if it knows the lens it gives a name that (at least for now) contains some alphabetic characters. I'd go with that heuristic.

#9 Updated by Michael Born over 5 years ago

edit
sorry, the Leica lens information just showed up correctly, because this information was in DTs database. When importing new files, the lens is still not detected - just the numbers are displayed.

#10 Updated by Roman Lebedev about 5 years ago

  • Related to Bug #10411: Lens not recognized by "lens correction" module added

#11 Updated by Pascal de Bruijn about 5 years ago

Considering we need close matches for lensfun, I'm increasingly beginning to think that having a heuristic isn't a good idea to begin with. As the vendor provided string may mismatch Lensfun's lens description, which usually matches Exiv2's naming.

#12 Updated by Michael Born about 5 years ago

Do we have a vendor provided string here?
I thought the "LensModel" and "LensType" strings are just provided by the exiv2 library.

#13 Updated by Jan Niklas Fingerle about 5 years ago

The following holds for Four Thirds Olympus cameras and lenses:

  • Exif.OlympusEq.LensType is a six byte encoded value that gets translated by exiv2.
  • Exif.OlympusEq.LensModel is a 32 byte string that is provided by the camera.
  • Exif.Photo.LensModel is not part of the data.

Example with untranslated values (-pv parameter):

xxx@yyy ~/zzz/RAW/2008/2008-12/2008-12-30 $ exiv2 -pv OL301022.ORF|grep -i lens
0x0201 OlympusEq    LensType                    Byte        6  0 0 35 0 1 0
0x0202 OlympusEq    LensSerialNumber            Ascii      32  212686538
0x0203 OlympusEq    LensModel                   Ascii      32  OLYMPUS 14-42mm Lens
0x0204 OlympusEq    LensFirmwareVersion         Long        1  4869
0x020b OlympusEq    LensProperties              Short       1  49223

The following holds for Micro Four Thirds Olympus cameras and lenses:

  • Exif.OlympusEq.LensType is a six byte encoded value that gets translated by exiv2.
  • Exif.OlympusEq.LensModel is a 32 byte string that is provided by the camera.
  • Exif.Photo.LensModel is a 32 byte string that is provided by the camera with the same content as Exif.OlympusEq.LensModel

Example with untranslated values (-pv parameter):

xxx@yyy ~/zzz/RAW/2014/2014-09/2014-09-12 $ exiv2 -pv JNF20096.ORF|grep -i lens
0x0201 OlympusEq    LensType                    Byte        6  0 0 25 16 0 0
0x0202 OlympusEq    LensSerialNumber            Ascii      32  AC5275071
0x0203 OlympusEq    LensModel                   Ascii      32  OLYMPUS M.12-40mm F2.8
0x0204 OlympusEq    LensFirmwareVersion         Long        1  4114
0x020b OlympusEq    LensProperties              Short       1  49472
0x0403 OlympusEq    ConversionLens              Ascii      32  
0xa432 Photo        LensSpecification           Rational    4  12/1 40/1 28/10 28/10
0xa434 Photo        LensModel                   Ascii      32  OLYMPUS M.12-40mm F2.8

Examples with translated strings can be seen in my earlier comment.

Sorry, I don't own an adapter and therefore cannot say what MFT camera with FT lens will yield.

So, only LensType is provided by the exiv2 library, LensModel is provided by the vendor/camera. But LensModel in FT cameras is at best sub-optimal, because it contains only a generic string. In certain cases this string will be the same for different lenses.

Therefore the heuristic should be, from my point of view:
  • If Exif.OlympusEq.LensType is not present do everything as before; break; (reason: no Olympus, therefore nothing to do differently)
  • If Exif.OlympusEq.LensType is present but contains a string consisting of six decimal numbers (if you view the hexdump with -ph you can see that the other values are decimal): Use Exif.OlympusEq.LensModel - in case this isn't present, use Exif.Photo.LensModel; break; (reason: Exif.OlympusEq.LensType would be better, because it's the string used by lensfun and because Exif.OlympusEq.LensType is not very descriptive for FT cameras, but Exif.OlympusEq.LensType is better than some weird decimal representation of a six byte technical value; the second fallback will, for all i know, never be triggered, but just in case ...)
  • If you're here, then Exif.OlympusEq.LensType is present and contains sensible data; use it. (reason: it's the better value, if it is present, and it is)

#14 Updated by Jan Niklas Fingerle about 5 years ago

Just to add, I don't really speak C, but I'd be more than willing to informally review a pull request and see if the logic changes seem plausible - if this would be of any help. :-)

#15 Updated by Luis Florit about 5 years ago

darktable-1.6.4 fixed the same problem with the Zuiko 12-40, but the Panasonic 100-300 is still not recognized (lensfun-0.2.8-3 with databases from http://wilson.bronger.org/db/version_0.tar.bz2, exiv2 0.23). This is what exiv2 shows:

Exif.OlympusEq.LensType Byte 6 2 0 9 16 0 16
Exif.OlympusEq.LensSerialNumber Ascii 32 13091000840
Exif.OlympusEq.LensModel Ascii 32 LUMIX G VARIO 100-300/F4.0-5.6
Exif.OlympusEq.LensFirmwareVersion Long 1 4608
Exif.OlympusEq.LensProperties Short 1 49728
Exif.Photo.LensSpecification Rational 4 100/1 300/1 40/10 56/10
Exif.Photo.LensModel Ascii 32 LUMIX G VARIO 100-300/F4.0-5.6

DT drop down menu for lens selections shows Lumix G Vario 100-300mm f/4.0-5.6 that is the entry in the lensfun database (mil-panasonic.xml). I tried to change the lens name in the database to LUMIX G VARIO 100-300/F4.0-5.6 as exiv2 shows without luck.

#16 Updated by Luis Florit about 5 years ago

Actually, the problem with the m.Zuiko 12-40 is still not solved: lens not recognized.

#17 Updated by Luis Florit about 5 years ago

I solved the issues by compiling myself exiv2, and then substituting /usr/lib/libexiv2.so.12.0.0 by the compiled libexiv2.so.13.0.0. Yet, I had to make a manual change in mil-olympus.xml, since there was a "Pro" missing in the description of the 12-40.

#18 Updated by Jan Niklas Fingerle about 5 years ago

I've given it a try: https://github.com/jnfingerle/darktable/tree/bug-10284

Beware, I'm not really a C/C++ coder and this is not really tested (it's too late, give me some time). Feedback would be welcome an if someone wants to improve on that code, feel free.

#19 Updated by Jan Niklas Fingerle about 5 years ago

I've done some additional testing in my old-ish version. It seemed to work as expected. Then I rebased the change to the current trunk and merged some conflicting lines, nothing big. Since the current master doesn't compile on my machine with ...

collect2: error: ld terminated with signal 6 [Abgebrochen]
/usr/bin/ld: ld: wcsrtombs.c:99: __wcsrtombs: Zusicherung »data.__outbuf[-1] == '\0'« nicht erfüllt.
make[2]: *** [src/libdarktable.so] Fehler 1
make[1]: *** [src/CMakeFiles/lib_darktable.dir/all] Fehler 2
make: *** [all] Fehler 2

... (sorry for the German) I cannot check if it still works there. Anyway, the branch at https://github.com/jnfingerle/darktable/tree/bug-10284 should fix the bug for all i know. I may try longer and harder when I find the time again.

#20 Updated by Jan Niklas Fingerle about 5 years ago

Well, it seems, all I had to do was to delete the build directory. After successful compilations against different versions of libexif2, according to my tests everything works as expected.

#21 Updated by Pascal de Bruijn about 5 years ago

We're merged your pull request.

However I've added the following:
https://github.com/darktable-org/darktable/commit/515faa5d4fca23bf465e616df1fff56580a98a99

Could you test that on your end as well?

#22 Updated by Jan Niklas Fingerle about 5 years ago

It works on my end.

I get the message twice, which would, as I believe, mean the the function is called twice, so this would be outside the scope of this issue.

Thanks and keep up with the good work. :-)

#23 Updated by Michael Born about 5 years ago

With the current git branch darktable-1.6.x (last commit c4cc036a393b4bc7196bd96e9925f894d8cf0594 ) The lens detection of DT works for me.
On the terminal, I get some warnings (see below), but the lens correction module can be activated and just works :-)

Thank you very much.

[exif] Warning: lens "OLYMPUS M.25mm F1.8" unknown as "0 0 34 16 0 0"
[exif] Warning: lens "LEICA DG SUMMILUX 15/F1.7 " unknown as "2 0 34 16 0 16"

#24 Updated by Pedro Côrte-Real over 4 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Fixed

Also available in: Atom PDF

Go to top