Tamron SP AF 28-75mm F2.8 XR Di supported?

Exiftool query (selection):

[MakerNotes]    0x0000 Lens Type                       : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro
[MakerNotes]    0x0001 Lens Type                       : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro
[Composite]          - Lens ID                         : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro

and

[EXIF]          0x0103 Compression                     : Pentax PEF Compressed
[EXIF]          0x010f Make                            : PENTAX
[EXIF]          0x0110 Camera Model Name               : PENTAX K-5
[MakerNotes]    0x0000 Pentax Version                  : 7.0.0.0
[MakerNotes]    0x0001 Pentax Model Type               : 0
[MakerNotes]    0x0005 Pentax Model ID                 : K-5
[MakerNotes]    0x0000 Pentax Model ID                 : K-5

The lens is not found and cannot be set manually with dt.

Could it be that the camera doesn’t write the exif-tag for the lens and that is the reason why there is no correction?

I can filter with exiftool and never see Exif-data for the lens.

[MakerNotes]    0x0000 Lens Type                       : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro
[MakerNotes]    0x0001 Lens Type                       : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro
[MakerNotes]    0x0009 Lens Focal Length               : 55.0 mm
[Composite]          - Lens ID                         : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro

I know when it comes to details, I have to post to lensfun, but first I want to know, if there is something other wrong.

This one is supported:
Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF) Macro
as mentioned at:

How can I make mine an alias?

have a look at User's portal · darktable-org/darktable Wiki · GitHub

3 Likes

My lens is wrongly identified!

$ exiv2 -pa --grep test.pef 

exiv2: error while loading shared libraries: libexiv2.so.27: cannot open shared object file: No such file or directory

Do I miss a package?

ii  exiv2                                           0.28.8+dfsg-1                              amd64        EXIF/IPTC/XMP metadata manipulation tool
ii  gir1.2-gexiv2-0.10:amd64                        0.14.6-2                                   amd64        GObject-based wrapper around the Exiv2 library - introspection data
ii  libexiv2-28:amd64                               0.28.8+dfsg-1                              amd64        EXIF/IPTC/XMP metadata manipulation library
ii  libexiv2-data                                   0.28.8+dfsg-1                              all          EXIF/IPTC/XMP metadata manipulation library - shared data
ii  libgexiv2-2:amd64                               0.14.6-2                                   amd64        GObject-based wrapper around the Exiv2 library
ii  libkexiv2qt6-0:amd64                            25.12.3-0ubuntu1                           amd64        Qt like interface for the libexiv2 library

Looks like libexiv2-28 is installed and 27 is missing.

As said above, that’s a lensfun/exiv2 issue. Darktable can’t do anything about it.
As @MStraeten suggested, using a .exiv2 file seems like the easiest way to get your lens recognised (the lens ID can be identified with exiftool).

Note that is doesn’t mean you have a different lens, the reported name can depend on when or where you bought the lens.

That has nothing to do with darktable, but with your local installation. And from the package list you showed, it shouldn’t happen. Unless there is a package libexiv2 (without :amd) available?

Or you have another exiv2 executable installed under e.g. /opt. (and that version appears earlier in your path.). To check that, perhaps which exiv2 shows something useful?
Note that you don’t need the exiv2 executable for darktable.

And to get the lens ID you need for the .exiv2, you should be able to use exiftool (perhaps with the -e option?).

1 Like

I agree this is not a dt problem, but it influences the dt result a lot.

I hope I could get it working with Xubuntu 26.04

$ which exiv2
/usr/bin/exiv2
$ exiv2 --version
exiv2 0.28.8
$ exiv2 -pa --grep lens/i test.pef 
Exif.Pentax.LensType                         Byte        4  Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro (A09)
Exif.Pentax.LensInfo                         Undefined  91  1 132 0 0 49 50 0 0 0 0 0 0 0 40 220 32 133 119 2 4 98 89 106 89 48 0 3 49 90 35 255 255 255 49 3 101 3 3 0 0 136 8 68 3 0 0 0 207 242 0 0 0 0 132 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

From the github-explanation:

If we look at the underlying data, we see this LensType code actually equates to a LensID of 368:

$ exiv2 -pv --grep lens/i test.pef 
0x003f Pentax       LensType                    Byte        4  4 49 0 0
0x0207 Pentax       LensInfo                    Undefined  91  1 132 0 0 49 50 0 0 0 0 0 0 0 40 220 32 133 119 2 4 98 89 106 89 48 0 3 49 90 35 255 255 255 49 3 101 3 3 0 0 136 8 68 3 0 0 0 207 242 0 0 0 0 132 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

There is no code for the lens.

A long time ago I had a hack using

~/.local/share/lensfun

but I don’t remember exactly.

I think the exiftool query is not helpful too.

$ exiftool -G -H -a test.pef | grep -i lens

[MakerNotes]    0x0000 Lens Type                       : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro
[MakerNotes]    0x0001 Lens Type                       : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro
[MakerNotes]    0x0009 Lens Focal Length               : 55.0 mm
[Composite]          - Lens ID                         : Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro

$ exiftool -G -H -a -n test.pef | grep -i lens

[MakerNotes]    0x0000 Lens Type                       : 4 49
[MakerNotes]    0x0001 Lens Type                       : 4 49
[MakerNotes]    0x0009 Lens Focal Length               : 55
[Composite]          - Lens ID                         : 4 49

I’d try an ID value of 1073 in the .exiv2 file

1 Like

Hello,

I have the same lens that I used with my Pentax K-5 and now with my Pentax K-1.
This lens is indeed listed in LensFun, but the name is slightly different and so it isn’t recognised.
To sort this out, I’ve placed this file in the LensFun directory. For example, on Debian 13, this is ‘/usr/share/lensfun/version_1’.
Here is the file for this lens. Lens.zip (1.4 KB)

Greetings from the Luberon, :herb:
Christian

1 Like

Can you please provide a full line using my queries?

Me too. I have a K1 too.

I fear there are 2 steps to solve the problem. The lens is not mentioned with Exif-data. So the first step, must be, that darktable recognizes the lens.

The 2nd step is, that lensfun uses the configuration file.

I searched the web and my notes, but I am not sure how to do everything right.

~# lensfun-update-data
Reading http://lensfun.sourceforge.net/db/versions.json …
Reading http://wilson.bronger.org/lensfun-db/versions.json …
Successfully updated the database in /var/lib/lensfun-updates/version_1.

With the latest Ubuntu:

~# dpkg -l | grep -i lensfun
ii  liblensfun-bin                                  1:0.3.4-2                                  amd64        Lens Correction library - Utilities
ii  liblensfun-data-v1                              1:0.3.4-2                                  all          Lens Correction library - Data
ii  liblensfun1:amd64                               1:0.3.4-2                                  amd64        Lens Correction library - Runtime files
ii  python3-lensfun                                 1:0.3.4-2                                  amd64        Lens Correction library - Python3 module

Since years there is at sourceforge:

There is a directory with:
.../lensfun-0.3.95/data/db/

and a file slr-tamron.xml

    <lens>
        <maker>Tamron</maker>
        <model>Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF)</model>
        <model lang="en">Tamron SP AF 28-75mm f/2.8 XR Di (IF) Macro</model>
        <mount>Canon EF</mount>
        <mount>Nikon F AF</mount>
        <mount>Pentax KAF</mount>
        <mount>Sony Alpha</mount>
        <cropfactor>1</cropfactor>
        <calibration>
            <distortion model="ptlens" focal="28" a="0.01469" b="-0.034774" c="0"/>
            <distortion model="ptlens" focal="30" a="0.012441" b="-0.026997" c="0"/>
            <distortion model="ptlens" focal="35" a="0.009958" b="-0.018577" c="0"/>
            <distortion model="ptlens" focal="50" a="0" b="0.005421" c="0"/>
            <distortion model="ptlens" focal="60" a="0" b="0.00752" c="0"/>
            <distortion model="ptlens" focal="75" a="0" b="0.007321" c="0"/>
        </calibration>
    </lens>

Unanswered is the “lensdatabase version”

So I think it could work to create the same configuration locally a 2nd time.

My lens:
Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro

lensfun name:
Tamron SP AF 28-75mm f/2.8 XR Di (IF) Macro

So the difference is the slash in f/2.8 and “LD Aspherical”

My idea is to copy the lens configuration in slr-tamron.xml a 2nd time with my values and then copy the file from the sourforge-download to ~/.local/share/lensfun

/usr/share/lensfun/version_1/slr-tamron.xml exists in my system. I hope the file in ~/.local/share/lensfun is prioritized.

    <lens>
        <maker>Tamron</maker>
        <model>Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF)</model>
        <model lang="en">Tamron SP AF 28-75mm f/2.8 XR Di (IF) Macro</model>
        <mount>Canon EF</mount>
        <mount>Nikon F AF</mount>
        <mount>Pentax KAF</mount>
        <mount>Sony Alpha</mount>
        <cropfactor>1</cropfactor>
        <calibration>
            <distortion model="ptlens" focal="28" a="0.01469" b="-0.034774" c="0"/>
            <distortion model="ptlens" focal="30" a="0.012441" b="-0.026997" c="0"/>
            <distortion model="ptlens" focal="35" a="0.009958" b="-0.018577" c="0"/>
            <distortion model="ptlens" focal="50" a="0" b="0.005421" c="0"/>
            <distortion model="ptlens" focal="60" a="0" b="0.00752" c="0"/>
            <distortion model="ptlens" focal="75" a="0" b="0.007321" c="0"/>
        </calibration>
    </lens>
    
	<lens>
        <maker>Tamron</maker>
        <model>Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro</model>
        <model lang="en">Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro
        <mount>Canon EF</mount>
        <mount>Nikon F AF</mount>
        <mount>Pentax KAF</mount>
        <mount>Sony Alpha</mount>
        <cropfactor>1</cropfactor>
        <calibration>
            <distortion model="ptlens" focal="28" a="0.01469" b="-0.034774" c="0"/>
            <distortion model="ptlens" focal="30" a="0.012441" b="-0.026997" c="0"/>
            <distortion model="ptlens" focal="35" a="0.009958" b="-0.018577" c="0"/>
            <distortion model="ptlens" focal="50" a="0" b="0.005421" c="0"/>
            <distortion model="ptlens" focal="60" a="0" b="0.00752" c="0"/>
            <distortion model="ptlens" focal="75" a="0" b="0.007321" c="0"/>
        </calibration>
    </lens>

No idea, if this can be done with 1 block only?