Darktable / Lensfun / Canon R6 / Tamron 10-24 EF-S| Lens is included in Lensfun but not accesable in DT

Hi,
I’m struggeling with Lensfun and Darktable under Windows. I shoot pictures using the Canon R6 and the Tamron 10-24mm F/3.5-4.5 Di II VC. The lens is included in Lensfun as confirmed by browsing through the Tamron-XML file. However, I am unable to select this lens within Darktable when editing the CR3-data. It is just not there in the list.
Using “lensfun-add-adapter” I created an _mouns.xml file in Linux and transfered that content to a file on the windows system.

contents of the XML:

<lensdatabase version="1">

<mount>

<name>Canon RF</name>

<compat>Canon EF</compat>

<compat>Canon EF-S</compat>

<compat>Canon FD</compat>

<compat>DKL</compat>

<compat>Generic</compat>

<compat>M39/1</compat>

<compat>M42</compat>

<compat>T2</compat>

<compat>Tamron Adaptall</compat>

</mount>

</lensdatabase>

The file is stored in:
C:\Program Files\darktable\share\lensfun\version_1

Still, the Tamron lens is not available for lens correction.

Is this a new problem or am I doing something wrong?

Best regards,
Steffen

Hi Steffen and welcome to the forum,

perhaps you may read the CR3 using exiftool (see https://exiftool.org/ for the Windows x64 download) to see which lens and crop factor is reported. I had a similar issue with a Sigma Art lens, that was included in the database, but not recognized for my Nikon F mount. I had to provide an exiv2.ini file to workaround this (see below).

To read the meta data with exiftool, open a cmd, try "pathToExiftool\exiftool.exe" "pathToCR3" | findstr /i "lens" and "pathToExiftool\exiftool.exe" "pathToCR3" | findstr /i "factor" which will reduce the output. The double quotes are only required, if there is white-space in a path.

Look for the reported combination of lens ID and crop factor and see, if it matches with the lensfun database. If not, you may edit the database and / or add a shortcut for darktable by providing an exiv2.ini file (see Exiv2 - Image metadata library and tools) and add an alias entry for the lens ID number as follows

[canon]
lensIdNumber=Tamron 10-24mm f/3.5-4.5 Di II VC HLD B023

As I’m using a Nikon, I can’t try this here on my side in full, but I hope that you got enough hints to solve the problem. Please also give the forum search a try, if you are still struggling… If the above mentioned method solves the problem, it may be an idea to track an issue for exiv2, lensfun or darktable on github depending on where the solution points to :wink:

Good luck and have a wonderful x-mas time, Lars.

P.S.: assuming you are running latest version of dt, which is 5.0 as of yesterday.

By looking at the slr-tamron.xml there seems to be only data for APS-C sensors.

    <maker>Tamron</maker>
    <model>Tamron 10-24mm f/3.5-4.5 Di II VC HLD B023</model>
    <model lang="en">Tamron 10-24mm f/3.5-4.5 Di II VC HLD</model>
    <mount>Canon EF</mount>
    <mount>Nikon F AF</mount>
    <cropfactor>1.6</cropfactor>

This is why you can’t select it for your R6. You could modify the xml or select the generic crop-factor 1.6 camera in the lens correction module, but since the correction data was made for APS-C, you probably won’t get accurate results. Better make your own correction data.

1 Like

Correct!

better use exiv2 for that to be sure that you’ll get the same results as used in darktable since the handling of some non native lenses might differ:
described in User's portal · darktable-org/darktable Wiki · GitHub

1 Like

Hi Lars,

thank you very much for your help. I could take a step forward but am stuck again :slight_smile:

using the exiv2-tool the following output was created:

.\bin\exiv2.exe -pv --grep lens/i image_of_choice.CR3
0xa432 Photo        LensSpecification           Rational    4  10/1 24/1 0/1 0/1
0xa434 Photo        LensModel                   Ascii      43  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
0xa435 Photo        LensSerialNumber            Ascii      11  0000000000
0x0016 CanonCs      LensType                    Short       1  508
0x0017 CanonCs      Lens                        Short       3  24 10 1
0x003d CanonFi      RFLensType                  SShort      1  0
0x0095 Canon        LensModel                   Ascii     138  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
0x000a CanonLiOp    DigitalLensOptimizer        SLong       1  1
0x0000 CanonLe      LensSerialNumber            Byte        5  0 0 0 0 0
0x0007 CanonAfC     USMLensElectronicMF         SLong       1  3
0x000b CanonAfC     LensDriveWhenAFImpossible   SLong       1  0

.\bin\exiv2.exe -pa --grep lens/i image_of_choice.CR3
Exif.Photo.LensSpecification                 Rational    4  10-24mm
Exif.Photo.LensModel                         Ascii      43  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
Exif.Photo.LensSerialNumber                  Ascii      11  0000000000
Exif.CanonCs.LensType                        Short       1  Tamron 10-24mm f/3.5-4.5 Di II VC HLD
Exif.CanonCs.Lens                            Short       3  10.0 - 24.0 mm
Exif.CanonFi.RFLensType                      SShort      1  n/a
Exif.Canon.LensModel                         Ascii     138  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
Exif.CanonLiOp.DigitalLensOptimizer          SLong       1  Standard
Exif.CanonLe.LensSerialNumber                Byte        5  0000000000
Exif.CanonAfC.USMLensElectronicMF            SLong       1  (3)
Exif.CanonAfC.LensDriveWhenAFImpossible      SLong       1  Continue Focus Search

.\bin\exiv2.exe --print t --grep lens/i image_of_choice.CR3
Exif.Photo.LensSpecification                 Rational    4  10-24mm
Exif.Photo.LensModel                         Ascii      43  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
Exif.Photo.LensSerialNumber                  Ascii      11  0000000000
Exif.CanonCs.LensType                        Short       1  Tamron 10-24mm f/3.5-4.5 Di II VC HLD
Exif.CanonCs.Lens                            Short       3  10.0 - 24.0 mm
Exif.CanonFi.RFLensType                      SShort      1  n/a
Exif.Canon.LensModel                         Ascii     138  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
Exif.CanonLiOp.DigitalLensOptimizer          SLong       1  Standard
Exif.CanonLe.LensSerialNumber                Byte        5  0000000000
Exif.CanonAfC.USMLensElectronicMF            SLong       1  (3)
Exif.CanonAfC.LensDriveWhenAFImpossible      SLong       1  Continue Focus Search

After creating an “exiv2.ini” in “C:\User\Username” with

[canon]
508=Tamron 10-24mm f/3.5-4.5 Di II VC HLD B023

the output looks as follows

.\bin\exiv2.exe --print t --grep lens/i image_of_choice.CR3
Exif.Photo.LensSpecification                 Rational    4  10-24mm
Exif.Photo.LensModel                         Ascii      43  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
Exif.Photo.LensSerialNumber                  Ascii      11  0000000000
Exif.CanonCs.LensType                        Short       1  Tamron 10-24mm f/3.5-4.5 Di II VC HLD B023
Exif.CanonCs.Lens                            Short       3  10.0 - 24.0 mm
Exif.CanonFi.RFLensType                      SShort      1  n/a
Exif.Canon.LensModel                         Ascii     138  TAMRON 10-24mm F/3.5-4.5 Di II VC HLD B023
Exif.CanonLiOp.DigitalLensOptimizer          SLong       1  Standard
Exif.CanonLe.LensSerialNumber                Byte        5  0000000000
Exif.CanonAfC.USMLensElectronicMF            SLong       1  (3)
Exif.CanonAfC.LensDriveWhenAFImpossible      SLong       1  Continue Focus Search

Since the lens appears as the same string in Exif.Photo.LensModel / Exif.CanonCs.LensType / Exif.Canon.LensModel , thus exiv2 seems to find the exivs2.ini-file.

However, darktable v5.0 seems not to find the alias 508 = Tamron-lens.
Do I miss something (config?)?

Best regards,
Steffen

Hi,
it is actually an APS-C lens, mounted on a full-frame body.
Btw, don’t update the lens-software using the tap-in console. It will foce the R6 to work in crop-mode only.

Best regards,
/Steffen

Hi,
using the “generic, crop-factor 1.6 (Canon APS-C)” inside the lens correction module enables the full range of Tamron lenses, thus the 10-24mm lens is available.
As you wrote, it is unclear how accurate the corection data are. This is beyond my abilities to test and to modify.

Best regards,
Steffen

I think if you use crop-mode, the available data should be fine. But for the full sensor you may consider trying to create your own data. There are some tutorials for this.

Or YT: https://www.youtube.com/results?search_query=lensfun+hugin+tutorial

1 Like

If I were you and only had that lens for R6 and no other crop camera I would just change the crop factor for the lens to 1 instead of 1,6.
The next time you update Lensfun that wil be reset.

The profile in the Lensfun database is missing vignetting so you may want to take the raw samples needed.

In a perfect world the software should recognize the crop factor used by R6, but it doesn’t.

Strange. For me this alias-method worked as long as I had it activated on my system. As I don’t know what your R6 reports as crop factor in the CR3 when using the APS-C lens on a full frame sensor, please double check that using exiftool or exiv2.

I may just imagine, that it still reports a crop of 1 instead of 1.6 and therefore the lens correction module in dt doesn’t offer the lens entry in the list as it has a crop of 1.6 bind. So unfortunately no further ideas on my side at the moment :man_shrugging:

Best regards,
Lars.