My tamron lens is not automatically detected. [solved]

When I select a photo in darktable that was taken with my Tamron 70-200 f2,8 Di (G1) lens with my Canon 80D camera it is not recognized correctly.

In the lens correction module it is showed as “255” under the correct camera “Canon, EOS 80D”.

If I select the lens drop down, I can find tamron 70-200 f2,8 lens in the database and apply the correction.

So I guess that lenses identify themselves differently under different camera branches, and mine is not still in the canon database.

It would be great that the lens were automatically identified.

Is there a way to contribute to the lens database in order to get this lens identified correctly in canon cameras for future releases?

How can I contribute?

Lots of projects (both free and non free software) use a library called lensfun. We have a tutorial about generating corrections for your camera and lens here: PIXLS.US - Create lens calibration data for lensfun

@paperdigits Do you know which EXIF line lensfun looks at (directly or indirectly) to identify a lens? With that knowledge it would be easy to ask our Spanish caballero to extract what his images report – as a first step towards Nirvana…

Have fun!
Claes in Lund, Sweden

1 Like

@Claes lensfun doesn’t do any name matching. You tell lens fun which profiles to load for body and lens, then it does the correction. Name matching is done by a different library, depending on the application we’re talking about. darktable uses exiv2, RawTherapee uses code derived from exiftool, and ART uses both exiv2 and exiftool. Determining the lens name is actually fairly complicated (sadly)… see some of the posts from @clanmills for further info.

For darktable, you can make a ~/.exiv2 file that statically iists the lensID and the lens model name.

2 Likes

@paperdigits Hmmmm. Please let me re-phrase myself:
What would be the easiest way for our Spanish caballero
to find out what lens name his images really report?

The reported “name” is 255, which comes from one of the maker notes fields. That is generally how it s reported. Exiv2/exiftool runs some heuristic to figure out the make and model of the camera body, then tries to deduce the lens. Of course, the lens 255 might not be the same lens between two different manufacturers (e.g. I have this lens as well, the 70-200 f2.8 tamron, fantastic lens, BTW). Not at a computer, so i can’t say what it reports, but I shoot Nikon.

1 Like

The correction for my lens exists and I think it is correct.

As I have said it is a Tamron 70-200 f2,8 Di (G1 version not the modern G2).

The problem is that it is not identified in my canon camera, I don’t know why.

It is identified just as “255”.

I can browse the database and select the correct one. But it would be great if it is detected automatically.

As you probably know, tamron (just like sigma) has the same lenses for various mounts, Canon EOS, Nikon…

I suppose that the number or id for the lens is different in canon and Nikon and it is not correctly identified or nobody provided the correct id for a canon EOS mount.

That is why I am asking how can I get the correct data and where to provide it.

Thank you that is exactly what I am asking for.

I have made the question tagged as darktable, I am using darktable as application.

So I guess I should use something called exiv2 (I am in a windows machine) but I don’t know yet how I am suposed to use it and where to report the results in order to correct this for forcoming versions.

I have dine some research.
It seems that the canon makernote is not being correctly by exiv2 or that nobody has reported the contén of exif.canon.lensmodel for this tamron lense in a canon machine.
Where should i report it and how can i get this field using a windows machine?

¡Hola

As @paperdigits wrote (above):

For darktable, you can make a ~/.exiv2 file that statically iists the lensID and the lens model name.

More info about that special file here:

A dilemma (for me) is that you are using Windows, which means that I am not able to assist you further.

Have fun!
Claes in Lund, Sweden

2 Likes

Yes, i am using windows and am not surethata exiv2 commandlkne utility exists.
Thanks for the link i will read to see if it helps and tells me where to inform the results.

But i guess all i woul get forthat field is just 255 as the id of the lens model.

What is ~/exiv2 ?
Do you mean there is no central database and each user has to maintain his own config file mapping the lenses he uses?

Well I have managed to install exiv2 in my windows machine an run it against some of the images take with the tamron.

I think the relevan info is the Canon makernote called LensType.
As expected it just shows 255
There are other fields that identify the lens model too

0x0016 CanonCs LensType Short 1 255
0x0095 Canon LensModel Ascii 74 TAMRON SP 70-200mm F/2.8 Di VC USD A009
0xa434 Photo LensModel Ascii 40 TAMRON SP 70-200mm F/2.8 Di VC USD A009

Now the only thing is needed is map that lens identifier to the lensfun lens database ID.

Under darktable lens correction module, the lens name reads
Tamron SP 70-200mm f/2.8 Di VC USD

I have checked other lenses and they are automatically detected, like the tokina 11-16 or the canon 17-55.
So there must exist some central database for the mapping.

I would like to contribute that info in order to correctly identify this lens under canon cameras in fore coming releases.

Actually, it is lensfun that attempts to match the supplied lens nomenclature with its database contents. lfLens::findLens() returns a list of lenses that meet their match criteria.

This is a bit of a mess right now, with the root cause in most cases being that the camera doesn’t supply a text-string nomenclature in the image metadata, and the various softwares have to make them up from lens codes, or worse, an assertion based on a combination of other image metadata.

Thanks a lot for your answer but now i am in a complete mess.

I can provide the required exif data, but don’t know where to inform the problem in order to try get it fixed.

Under darktable photos with this lens are showed as take with a lens “255”.
It seems that the library is using the LensType under CanonCs exif data (makernotes?).

But there are other fields listing it as 0xa434 Photo LensModel Ascii 40 TAMRON SP 70-200mm F/2.8 Di VC USD A009

In the lensfun database there is not the trailing A009 in the nomenclature.
May be that the problem?

UPDATED:

under share/lensfun/version1 there is the slr_tamron.xml file.

In it you can find the lens with exactly the same name that appears in exif as LensModel, with the A009 at the end.
Just one difference TAMRON appears capitalized in the lens model instead of Tamron.

I have changed the file, to save it as TAMRON, close and opened darktable, but the problem remains.

The link posted by @claes tells you what the ~/.exiv2 file is. Did you read that thread? I think all your answers are in there.

Yes I read it, but it seems it is talking about Linux.

It seems to be a kind of configuration file. But I am not able to find that file in windows.

Update:
Ok I could find at last where it should be in windows, but it is not created by default, that is why I could not find it.

So create the file with the information for your lens, right?

I have been trying.
no way it does not work.

Under windows the file seems to be in c:\users\yourusername\exiv2.ini

Lensfun database identifies this lens as follows

    <maker>Tamron</maker>
    <model>Tamron SP 70-200mm f/2.8 Di VC USD A009</model>
    <model lang="en">Tamron SP 70-200mm f/2.8 Di VC USD</model>

I was not sure if A009 is needed or not.

As I have reported earlier, using exiv2 to get lenstype and model gives you
0x0016 CanonCs LensType Short 1 255
0x0095 Canon LensModel Ascii 74 TAMRON SP 70-200mm F/2.8 Di VC USD A009
0xa434 Photo LensModel Ascii 40 TAMRON SP 70-200mm F/2.8 Di VC USD A009

So I have tried every combination of them

[canon]
255=Tamron SP 70-200mm f/2.8 Di VC USD

[canon]
255=Tamron SP 70-200mm f/2.8 Di VC USD A009

[canon]
255=TAMRON SP 70-200mm f/2.8 Di VC USD A009

with no success under darktable.

I have closed and opened darkatable each time with no success.

The difference is that when i run now exiv2 it reports LensType for the provided name and not as 255

Exif.CanonCs.LensType Short 1 Tamron SP 70-200mm f/2.8 Di VC USD

So it seems that exiv2 is reading the exiv2.ini file and working, but not darktable.

May be it only works in the command line tool and not the library.

But darktable reports lens as 255 each time.

I can provide a raw file if demanded in order to see if it just a problem with windows or it happens in Linus too.

In a moment of inspiration, I have deleted all the photos from the database and reimported them

Now when I open one of the photos taken with this lens it recognizes it correctly.

This is the current config of the exiv2.ini file, in case it helps somebody:

[canon]
255=Tamron SP 70-200mm f/2.8 Di VC USD A009

I have no problem now with that exiv2.ini file but others that have the same lens in a canon EOS camera (APS in case that matters) may have that problem.
If anybody is able to report it to the appropiate place in order to get this solved for future versions it would be great.

1 Like

It isn’t clear to me if lens fun also needs the camera body type to correctly use the lens correction. e.g., if the lens correction for a lens was done with a full frame camera, will the same correction be applicable to an APC camera? Maybe someone can let me know :stuck_out_tongue: