What I found is that in darktable it was searching for the name Canon EF 300mm f/2.8L IS
I changed slr-canon.xml from EF300 f/2.8L IS USM to Canon EF 300mm f/2.8L IS and that one works now. So it reads LensType and not LensModel.
x1.4 II and x2 III worked before but now none of the three converters are identified.
In this case it will be me who sends the data to Lensfun. If it doesnt work for me it will not work for others. If this would be about another lens already in Lensfun, then .exiv2 would be the best solution for just me.
With that said my biggest issue is still that I can get one of the four combinations to work, but not four.
Nothing new there. Try yourself with my raw files. The issue here is extenders. Not a single lens. A single lens is easy and that is what you have been linking to all the time.
It seems .exiv2 is not created for a lens with different extenders so the walk around most be something else. Why, for example, is not darktable reading the tags LensModel? A bug?
Tried with my 200/2.8L IS USM II. It works differently. LensType changes with the extender. Well, not for +1.4II and +1.4III. It means that it in this case would be possible to use .exiv2 to point it right, but only to choose one +1.4
Did see the link in your link (at exiv2) a few days ago about the extender case and with Tamron. Exiftool link was new to me. Third-party with the same LensID nr. A reason why I only use Canon lenses. Or it was a reason.
Have checked this a little bit more. The order darktable reads lens tags seem to be the culprit. Reading Exif.CanonCs.LensType before reading Exif.Photo.LensModel. It seems Canon Digital Photo 4 reads Exif.Photo.LensModel or Exif.Photo.LensModel first. Open a raw file in DPP4 and press CTRL+I. DPP4 will report EF35mm f/1.4L USM instead of Canon EF 35mm f/1.4L.
Some Canon lenses and cameras:
And the source code from darktable how to read the lens tags:
/* We have to check if Exif.OlympusEq.LensType has been translated by
* exiv2. If it hasn't, fall back to Exif.OlympusEq.LensModel. */
std::string lens(img->exif_lens);
if(std::string::npos == lens.find_first_not_of(" 1234567890"))
{
/* Exif.OlympusEq.LensType contains only digits and spaces.
* This means that exiv2 couldn't convert it to human readable
* form. */
if(FIND_EXIF_TAG("Exif.OlympusEq.LensModel"))
{
dt_strlcpy_to_utf8(img->exif_lens, sizeof(img->exif_lens), pos, exifData);
}
/* Just in case Exif.OlympusEq.LensModel hasn't been found */
else if(FIND_EXIF_TAG("**Exif.Photo.LensModel**"))
{
dt_strlcpy_to_utf8(img->exif_lens, sizeof(img->exif_lens), pos, exifData);
}
fprintf(stderr, "[exif] Warning: lens \"%s\" unknown as \"%s\"\n", img->exif_lens, lens.c_str());
}
}
else if((pos = Exiv2::lensName(exifData)) != exifData.end() && pos->size())
{
dt_strlcpy_to_utf8(img->exif_lens, sizeof(img->exif_lens), pos, exifData);
}
// finally the lens has only numbers and parentheses, let's try to use
// Exif.Photo.LensModel if defined.
If I erase Exif.CanonCs.LensType, $ exiv2 -M"del Exif.CanonCs.LensType" 300x2III.CR2 darktable identify the lens correctly by searching for the next, and right, tag.
Problem solved. In the configuration file ~.exiv2 I wrote 142=000
It will probably fail for older Canon cameras that only have the tag LensType, but they will not find the converters anyway.
Same with EF 800mm f/5.6L IS USM from 2008 as with EF 300mm f/2.8L IS USM from 1999. Canon EF 70-200mm f/2.8L IS II USM was made 2010, so lenses after that should work.
Bypass the exiftag LensType in the configuration file .exiv2 so that it will use LensModel instead.