EXIF info in Darktable vs ART?

Sorry if this has been addressed ad nauseum but if so, it wasn’t readily findable (by me) …

It’s a bit more nuanced than the usual “CR3 exif info” discussions I’ve noticed. Specifically:

I often use a Viltrox 33mm AF lense on my Canon M6 Mark ii. When looking at images in ART (1.16.2), both the camera and lens info are accurately shown in the meta data. When looking at images in Darktable (4.0.1) , I see accurate camera model info and even 33mm focal length, but the lens is shown as “Canon EF-M 32mm” … which is not accurate (nor possible given the 32mm vs 33mm focal length difference).

Is this due to the different sources of EXIF being grabbed by each app?

Since the Viltrox lens is communicating properly with the camera body (and ART is reading this meta data accurately), there must be a simple reason that even the latest release of darktable is not.

Just curious?

What will exiv2 report if you write

exiv2 -pt yourfile.CR3 |grep -i 'lens\|model\|make'


exiv2 -pv yourfile.CR3 |grep -i 'lens\|model\|make'
1 Like

Great question.

In response to -pt I get:
Exif.Image.Make Ascii 6 Canon
Exif.Image.Model Ascii 21 Canon EOS M6 Mark II
Exif.Photo.LensSpecification Rational 4 32/1 32/1 0/1 0/1
Exif.Photo.LensModel Ascii 19 Viltrox AF 33/1.4M
Exif.Photo.LensSerialNumber Ascii 11 0000003311
Exif.CanonCs.LensType Short 1 Canon EF-M 32mm f/1.4 STM
Exif.CanonCs.Lens Short 3 32.0 mm
Exif.Canon.ModelID Long 1 EOS M6 Mark II
Exif.CanonFi.RFLensType SShort 1 n/a
Exif.Canon.LensModel Ascii 138 Viltrox AF 33/1.4M

In response to -pv I get:
0x010f Image Make Ascii 6 Canon
0x0110 Image Model Ascii 21 Canon EOS M6 Mark II
0xa432 Photo LensSpecification Rational 4 32/1 32/1 0/1 0/1
0xa434 Photo LensModel Ascii 19 Viltrox AF 33/1.4M
0xa435 Photo LensSerialNumber Ascii 11 0000003311
0x0016 CanonCs LensType Short 1 4159
0x0017 CanonCs Lens Short 3 32 32 1
0x0010 Canon ModelID Long 1 2065
0x003d CanonFi RFLensType SShort 1 0
0x0095 Canon LensModel Ascii 138 Viltrox AF 33/1.4M

Reading “exiv2 -h” doc, and given that -pt produces “interpreted (translated) Exif data” while -pv produces “plain Exif data values” makes me ponder…

I wonder how ART is making use of the accurate lens data (model and somehow deriving a focal length of 33mm) while darktable is using some kind of “interpreted” lens info from the meta data (i.e., inaccurate lens model and incorrect focal length).

Apparently exiv2 does some kind of interpretation upon which darktable relies (?) and ART does not(?).

Both recognize the correct camera model. Interesting.

In the configuration file .exiv2, write

4159=Viltrox AF 33/1.4M

1 Like

Thanks! I will need to dig deeper into this tweak.

So far, I had to create an .exiv2.ini file, since I haven’t been able to find any like this anywhere. I placed it under the .config/darktable folder. Not seeing any effect so I’m clearly not hitting on quite the right solution just yet. Will keep at it for a bit.

.exiv2 in home folder in Linux. Not exiv2.ini that is for Windows.

I looked in the exiv2 code, src/canonmn_int.cpp, in the canonCsLensType[] table one finds this line:

  { 4159, "Canon EF-M 32mm f/1.4 STM"                                 },

It would appear from your exiv2 runs that the Exif.LensModel tag has an ASCII entry containing “Viltrox AF 33/1.4M”

So, it appears ART is using the LensModel tag verbatim, and darktable is using the CanonCs.LensType ID and the corresponding exiv2 lookup.

Lens nomenclature in metadata is a bit of a circus; manufacturers don’t all report text nomenclature, so the libraries have had to do all manner of table lookups. More recent camera models seem to be doing a better job populating Exif.LensModel, but the softwares are still in various stages of their “road less-traveled” logic…

Thanks again! Eliminated the .ini extension, then tried placing the .exiv2 text file (no extension) I created with the 4159 definition in darktable directory in .config of my home directory, and then directly in the .config directory itself. No dice, still getting the incorrect lens showing up in meta data within darktable. Will play around further - seems straighforward enough now that you’ve aimed me in the right direction.

I, too, suspect this is what’s going on. A bit of a circus indeed :wink:

In home folder. Not in .config folder.

1 Like

That’s what I’ve been trying since reading your thoughtful reply. Apparently I’m just not doing something correctly as it makes no difference. For some reason darktable keeps showing me meta data for a lens I didn’t use (and don’t own) :wink:

Meanwhile ART works like a charm. Most likely an exiftool vs exiv2 difference.

I’ll try a few more times, but not holding out much hope at this point.

A print screen of your .exiv2 in the right folder?

If you write


darktable should use the next Exif tag after LensType, which is LensModel.

You have all LensType numbers here https://raw.githubusercontent.com/Exiv2/exiv2/main/src/canonmn_int.cpp

1 Like

You sure you have it in the right place? In your earlier post you said you tried putting it in ~/.config/darktable and ~/.config. Neither of those are correct. It should go directly in ~/.

1 Like

Confirmed. Since @Peter’s post above, I’ve been putting this .exiv2 text file I created in my home directory (~/ )

I continue to see the same “Canon EF-M 32mm f/1.4 STM” exif data down in “image information” for the lens field in darktable , whether I use a text name (4159=Viltrox AF 33/1.4M) or just replace it with 4159=0 within my .exiv2 text file.

Regardless, the Canon 32mm lens noted above continues to be shown as the lens field on screen within darktable.

@Peter and @montagdude - you’ve been generous with your time. TBH, this isn’t terribly important to me. At this time, I greatly enjoy using ART anyhow. I was just curious about why darktable - which recognizes the Canon M6ii body and gets a lot of the exif data right - still can’t get the right lens info (or accurate focal length data).

This might be a bigger concern for others who rely upon darktable. Not a major issue for me as much as a curiosity to solve for future reference.

1 Like

Did you refresh Exif in darktable, after you changed .exiv2? 4:42 in the tutorial.

About the order darktable uses to grab the right lens you find it here Lensfun - Not finding the right lens - #22 by Peter

1 Like

Not sure if this will help, but I have this in ~/.exiv2 left over from when I used darktable:

4208=30mm F1.4 DC DN | Contemporary 016

Maybe try adapting this to your situation. It may take a couple tries to get the name right, but I’m guessing it would be:

4159=Viltrox AF 33/1.4M
1 Like

Thanks to you both … will spend time on this again shortly and report back on results.

Yikes - no I did not! Refreshing the metadata solved it … now it’s working. Have to do that for each file individually.

Duh, I never thought to take that essential step.
Many thanks to you both - with my apologies for failing to RTFM. :grimacing:


You can browse by Lens in the Collections module. That should make it pretty easy. Select all and refresh.

1 Like

Bingo - works nicely. :+1: