My tamron lens is not automatically detected. [solved]

Yes, lens corrections made in a FF camera can be used in an APS sensor (not the reverse).
The aps sensor is just as a crop of the image, you just use the center of the image, but the lens behaves exactly the same.

Indeed as I could read in the lensfun database, lens correction for this lens has been made with a 6D camera which is FF.
I don’t know if lensfun can have any issue with that (it shouldn’t).

Most lens corrections in other software are made with data taken with a FF EOS camera and applied to aps.

when programming using the lensfun API, you create a lfModifier class that gathers all the information needed by the various correction algorithms. One of the things the programmer needs to pass to lfModifier is the mount crop factor, and the documentation says this about it:

imgcrop: The crop factor for the image to be processed. The distortion models will take this into account if lens models were measured on a camera with a different crop factor.

So us schlep programmers have to go rooting through the metadata for the crop factor…

An update to this problem.

I have reported it to darktable developers.

They don’t seem to care much about lenses not being correctly identified.
Somebody has just answered that it is an exiv2 problem (yes but darktable uses exiv2 and users do not neccesarily know each internal detail of the software).

I have tried to open an issue in exiv2.
They have answered that it is a pity that I were directed to report it to exiv2 developers.

It seems that 255 just means that the lens is not known.
From the answer I understand that when the camera firmware does not identify the lens it uses 255 as lens id.
So canon assigns that ID to every lens that is not manufactured by them.

Exiv2 seems to try to identify the lens in other ways (there are other EXIF lensModel that correctly identify the lens).
But if it cannot, then they return 255.

It is clear that there is a bug in exiv2 identifying this lens as they cannot recognize a lens that is clearly identied int he exif data.

But they don’t point you to any usefull info or ask you to provide infor in order to get it fixed for future versions, so I don’t expect this fixed.

The response has been quite dissapointing. I had expected a place where you could provide info in order to fix the lenses that cannot be correctly identified.
Given the responses, it is not strange that years after this lens has been released to the market, it is not correctly identified.

I you use the 255 to tamron mapping configuration, you will map any lens that is not identified by exiv2 to the lens you have mapped in your config file.

You were provided the information about the config file in the third response, by me, and that is disappointing? Exiv2 is under-manned. You expected someone to do the work for you, but that is not the way open source software works.

That solution is a patch, not a solution.

As I have explained right now 255 IS NOT the correct lens id for the Tamron lens

I expect that a program or library that says is able to automatically identify your lens do that : automatically identify your lens.

And when it fails to do so, it is a bug or misfunction of the program/library.
So I expect that users can contribute with info to solve the problem and in this case help to fix incorrectly identified lenses for future versions.

If I just correct it in my config file for me and do not provide feedback at all the problem will remain for upcoming releases.

That is how OPENSOURCE WORKS: if there is a problem, users provide feedback about the problem and are provided instructions about which tests they can do or what info they can provide to fix it.
Of course developers do that at their own pace you cannot expect every problem fixed inmediatly (neither in commercial software).

I don’t expect anybody to do my work.
Your response was not clear enough for me because it missed that I was using windows and not linux, and because a user of darktable does not know which other libraries/tools uses darktable.

But thanks to your contribution and others I could managed to find where the config file was.

I was convinced that the 255 was the correct ID for this lens, so I tried to provide it to be fix.

But it is not, as I was told 255 just means than your lens was not correctly identified.

Any lens not correctly identified would be assigned this ID. If you have two of this lenses you have a problem.

So making this change in my config is only a patch, that may work if you have only one lens with this problem and it won’t be fixed in the future meanwhile the algorithm that detects this lens is not changed.

I have used several other software that has no problem identifying the lens.
So yes, it is a software problem.

@ariznaf, could you post a raw file from your camera shot with that lens? It can just be a picture of the inside face of your lens cover; I just want to inspect the metadata recorded by the camera for that lens.

Of course, no problem nobody is going to steal may photos :smile:
The first I have seen with this lens.
80D-0270.CR2 (33.5 MB)

I was not sure if I could post a raw here, but you can.

Robin mills (one of the exiv2 developer) has answered me.

It seems a common problem with some lenses, it seems it is not so easy to fix problems with lens identification.
There is no standard way of doing things.
Sometimes Canon puts a unique ID of lenses they do not manufacture, others not.

It seems there are going to be in depth changes in the future to exiv2 in order to give the community a way to fix the lenses that are no correctly identified.
In his own words, exiv2 is mainly a way to read exif data and the goal to identify a lens correctly is not easy.

1 Like

Thanks!

Okay, this give me the chance to use my improved exiftool incorporation in rawproc. I opened your image, and used my EXIF dialog to run ‘exiftool -G -S -n’ against the file. Then, I filtered on the word ‘lens’ (case insensitive) to get all the tags related to the lens. Here’s the result:

[EXIF] LensInfo: 70 200 0 0
[EXIF] LensModel: TAMRON SP 70-200mm F/2.8 Di VC USD A009
[EXIF] LensSerialNumber: 0000000000
[MakerNotes] LensType: 255
[MakerNotes] LensDriveNoAF: 1
[MakerNotes] RetractLensOnPowerOff: 0
[Composite] Lens: 70
[Composite] LensID: 255
[Composite] Lens35efl: 108.800732768397

The -n switch tells exiftool not to ‘make pretty’ the values, just display them straight from the file. Sooo… Eureka! There is a string value with the lens nomenclature, in the EXIF data at that. I say it that way, because this appears to be a recent phenomenon with some camera manufacturers, actually using the standard EXIF tags to report on attached lenses. For some, they’ll put it in their priprietary MakerNotes; others, will just provide some other encoding like an ID.

To be complete, I did the same cull with exiv2:

glenn@caliente:~/Downloads$ exiv2 -pa 80D-0270.CR2  |grep Lens
80D-0270.CR2: (No IPTC data found in the file)
Exif.CanonCs.LensType                        Short       1  255
Exif.CanonCs.Lens                            Short       3  70.0 - 200.0 mm
Exif.Canon.LensModel                         Ascii      74  TAMRON SP 70-200mm F/2.8 Di VC USD A009
Exif.Photo.LensSpecification                 Rational    4  70/1 200/1 0/1 0/1
Exif.Photo.LensModel                         Ascii      40  TAMRON SP 70-200mm F/2.8 Di VC USD A009
Exif.Photo.LensSerialNumber                  Ascii      11  0000000000

So, the darktable could use the Exif.Photo.LensModel tag to look up the lens in lensfun, in this particular case.

Edit: So this would be a question for exiv2 folk: By chance, are you populating the Exif.Photo.LensModel with the Exif.Canon.LensModel contents, or is that straight from the camera?

Doesn’t this mean that exiv2 is working properly? It extracts all the useful information from the metadata.

Therefore it seems like the raw processor should recognize the right tag (the Exif.Photo.LensModel), forward it to lensfun and obtain the right information. And that currently fails. No?

If the raw processor is using exiv2, yes.

@ariznaf I’ve commented on your darktable GitHub issue, pointing them to this thread. I believe the issue is clearly with how darktable handles the extracted metadata. Not sure if this can be changed easily though…

Had you fully read the link, you’d see there is a command to show the location of the .exiv2 file.

@ggbutcher
Yes, the lens is correctly identified in other fields as I have said.

The question has been made, I have put an issue in darktable and in exiv2.

Each one says it is the other part problem, more or less (you can read more about it).

This is the issue in exiv2.

This in darktable

As @Thanatomanic points out, exiv2 has correctly done its job of providing exif data.

The tamron is not a canon lens, so in canon’s makersnote propietary exif data it identifies the lens as unknown (it sounds reasonable as canon ignores any lens that it has not manufactured for lens corrections or any other lens related processing, but it seems that for some lenses they provide an ID).

255 (-1 in you interpret is a a signed int) just means the lens has not been identified by canon firmware.
And other exif fields identify the lens correctly.

But it seems that till some time ago exiv2 tries to go a step forward from that and identify the lens and return a name for the lens doing some magic.

But it seems that they have dropped that some time ago there is an article of exiv2 developer saying he has dropped the towel.

To patch the 255 problem they provided the exiv2 config file to map it to a name manually.

But that is just a patch.
If they are not going to provide that kind of guessing magic, there are going to be more and more lenses identified as 255.

Well I cannot provide any more info or help about this, I man not a developer of any of the programs, just tried to help fix a problem with lens identification.

The only thing I’m curious about is how that EXIF tag is populated, if the Makernote tag is 255.

There is firmware in the lens as well, I’d assume it is able to write to the the raw file… just a guess though.

You could be part of the solution. If you think it can be done better, I’m sure the developers who are tight for time would welcome additional assistance.

@ariznaf and others: the issue has been fixed: exif: use Exif.Photo.LensModel when having only a number for Canon mo… · darktable-org/darktable@2782670 · GitHub

1 Like

That was my first intention with not too much success.
It seems that it has been already fixed, after a lot of confusion.

I tried to provide as much info as I could, but you cannot expect end users to know exactly what a program or library is doing or how it works.

It seems that the problem was not related to exiv2 at the end, nor to the lenstype 255 field.

Even when that fixed it for me, the problem was not related to that.

An mentioning that caused a lot of confusion and misunderstandings.

The problem seems to be a small bug in darktable that should use Exif.Photo.LensModel when the lens cannot be identified through the LensType, is it correct @Thanatomanic.

It seems it has been fixed and will be correct in upcoming versions.

So I think I should close this thread ( and the issue in darktable), shouldn’t I @Thanatomanic?

I am not sure what the community guides are about solved issues.

@Thanatomanic thanks for your help to explain this and get it fixed.

It was not easy to me to explain the situation in english.

@ariznaf Fernando, you could edit the title of this thread and put [Solved] in front or at the end. Other than that, there are no guidelines :slight_smile: The issue on GitHub has already been closed.

Some closing remarks: the initial thoughts in this thread by @Claes and @paperdigits were correct:, but things got more complicated after Mica mentioned the ~/.exiv2 file. The better approach - in hindsight - would have been to ask you for the RAW file immediately. Then everybody would have seen that the metadata was already correct. That could be everybody’s lesson in the future, always provide your problematic RAW file! :wink:

Happy to help!

3 Likes

I cannot edit the first thread nor its title, it seems you cannot after there are several answers.

May be it is due to me being quite recent in the forum (discurss lets you do more thing whe you are upgraded in level).
So I cannot mark it as solved. Anyway great thing having this solved.