Any lensfun/darktable expert here?

I’m using my 100-500 with the 1.4x extender sometimes and while I have a custom xml with the data, auto detection actually never works and depending on the name I put manually selecting the lens in the list either works or load without any corrections applied. Lensfun-update-data changes what is written in the list in darktable so loading the xml seems to work. I also tried putting a name in the exivrc file but to no avail.

Currently my xml entry is

    <lens>
        <maker>Canon</maker>
        <model>RF100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x</model>
        <model lang="en">Canon RF 100-500mm F4.5-7.1 L IS USM + RF1.4x</model>
        <mount>Canon RF</mount>
        <cropfactor>1.0</cropfactor>
        <calibration>
            <distortion model="ptlens" focal="420.0" a="0.003" b="-0.008" c="0.011" />
            <distortion model="ptlens" focal="508.0" a="0.002" b="-0.008" c="0.008" />
            <distortion model="ptlens" focal="560.0" a="0.003" b="-0.009" c="0.013" />
            <distortion model="ptlens" focal="599.0" a="-0.007" b="0.023" c="-0.020" />
            <distortion model="ptlens" focal="661.0" a="0.008" b="-0.033" c="0.044" />
            <distortion model="ptlens" focal="700.0" a="-0.002" b="0.005" c="0.002" />
            <tca model="poly3" focal="560.0" vr="0.9998182" vb="0.9999927" />
            <tca model="poly3" focal="599.0" vr="0.9997888" vb="0.9999732" />
            <tca model="poly3" focal="661.0" vr="0.9997803" vb="0.9999644" />
        </calibration>        
    </lens>

and exiv2 reports:

exiv2 -pa -g Exif 9T0A0662.CR3 | grep -i Lens
Exif.Photo.LensSpecification                 Rational    4  140-700mm
Exif.Photo.LensModel                         Ascii      48  RF100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x
Exif.Photo.LensSerialNumber                  Ascii      11  1014000772
Exif.CanonCs.LensType                        Short       1  Canon RF 100-500mm F4.5-7.1 L IS USM + RF1.4x
Exif.CanonCs.Lens                            Short       3  140.0 - 700.0 mm
Exif.CanonFi.RFLensType                      SShort      1  Canon RF 100-500mm F4.5-7.1 L IS USM + RF1.4x
Exif.Canon.LensModel                         Ascii     138  RF100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x
Exif.CanonLiOp.DigitalLensOptimizer          SLong       1  Aus
Exif.CanonLe.LensSerialNumber                Byte        5  1014000772
Exif.CanonAfC.USMLensElectronicMF            SLong       1  (4)
Exif.CanonAfC.LensDriveWhenAFImpossible      SLong       1  Fokus-Suche fortsetzen

Any pointers?

Just a wild guess (being no lensfun expert at all):
you have two different lens model strings in your database, that probably are used depending on your system language.

If lensfun (or darktable?) evaluates the generic Exif.Photo.* entry from the CR3 file (“RF100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x”) and not the Canon-specific entry, and if you have English as your system language, it would only find “Canon RF 100-500mm F4.5-7.1 L IS USM + RF1.4x” in the database and the comparison obviously would fail.

darktable should evaluate all model strings if I understood that correctly independent of the OS locale

Why do you have a custom xml?

because it is not officially in the database. All my profiles which are in testing are there and no issues so far

Does darktable or lensfun read the database? I assume it’s lensfun.

As I read its code, it returns the string matching the defined locale, or the one with “en” if no other locale is found. The generic one "RF100 … " is never returned - it would be returned only if not even an entry for “en” would be defined.

I would just delete the “en” entry from your custom database and try again. Or set the “en” entry to “RF100 …” too.

doesnt work. Also funny that the Canon EXIF reports this as 140.0 - 700.0 mm where it is 420 to 700 only.

When you look at the lens name in dt’s metadata panel, that name needs to match the name you put in lensfun. You can use an exiv2 config file to make the names match.

1 Like

Tried that and it didn’t help iirc. Wil try again

If the photo is already in DT and you’re changing things, you’ll need to refresh the metadata manually

1 Like

Yeah I did this as well. That’s why I am so confused. Nothing really works

So it would be:
138=Canon RF 100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x
under [canon]

and that name in lensfun right? If yes, doesn’t work. Also when manually selecting the entry, it does not apply any corrections.

Can you put some gibberish value here to test, like “piratenpamda plank lens” or something to make sure exiv2 is reading up your config file?

I’ve been using this file for several other lenses before so it should be loading fine but let’s try

ok so neither 138 or 48 seem to target the lens. Ah in exiv2 source code RF lenses have strange ids, let me look this up. Ok the ID seems to be the same for every lens exiv2/src/canonmn_int.cpp at 57684e1489af041fc54be6fdaa0110c2b9861639 · Exiv2/exiv2 · GitHub

ok so I’m out of ideas how to target this specific one

haha flashback to 2021 RF 100-500 wrongly identified as RF 100-500 + RF2x · Issue #1548 · lensfun/lensfun · GitHub

ok, this is how dt handles rf lenses

1 Like

So it’s a mismatch between what darktable reads, RF100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x in this case and what the metadata panel shows which is Canon RF100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x. But as I understand the issue this is nothing that can be remedied with the exiv2rc file.

Can you share some raw files?

Edit: ah, I wonder if DT is getting some info from libraw? Not sure on that one.

darktable retrieves “Canon RF 100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x” as a lens name, but you do not have this in your database.

You have “RF100-500mm F4.5-7.1 L IS USM + EXTENDER RF1.4x” and
“Canon RF 100-500mm F4.5-7.1 L IS USM + RF1.4x”, none of which fits to what darktable retrieves.

I tried that already