add lens information in darktable

Hi all,

Is there a canonical way of adding lens information in darktable? I’m not talking about lens correction and such, I would simply like to add basic lens information, if the lens is not included in the lensfun database.

Thanks,

Hi and welcome!

Is the lens electronic and add metadata to your raw file? If yes, you can use the exiv2 config file to map the metadata number onto a human readable name.

If you lens does not add metadata to your raw file, like vintage lenses, then I’d suggest using a tag to store the data.

1 Like

I believe there are some recent threads on the same topic. Try to search for those, as they probably have the answer.

1 Like

No, the lenses I’m talking about are not electronic, that’s the problem. I add tags, as you suggested, but I have an issue with that approach. Namely, darktable allows filtering of collections by lens, focal length and aperture. If I add all these in tags, then half of the pictures must be filtered through tags, the other half through the standard.

Before posting, I searched the threads. :wink: Most are related to incorrectly identified lenses, lens distortion corrections and the like. I’m really after being able to insert lens data manually.

Basically, what I’d like to have is pretty similar to adding geographical coordinates: you can do that in darktable in the map tab, and you can even override the coordinates, if your camera had a GPS receiver, and records those in the exif data.

1 Like

I would use exiftool from command line before import. E.g. I use “TS-E50mm f/2.8L MACRO” lens, and if information was not saved automatically I would add it with command:

exiftool -LensModel="TS-E50mm f/2.8L MACRO" -FNumber="5.6" image.CR3

There might also be other tags describing lens and other basic information.

Please test it carefully if these were the correct tags for the file types your camera uses. These can be added into RAW images. If you write these to RAW files, make sure that you have also a copy without these added. Exiftool might break something with those files and if that happens, maybe you can’t open them in the future.

Unfortunately I don’t know how to set this information directly from darktable. Maybe with some LUA scripts can use exiftool?

1 Like

Many thanks, Marko, for the suggestion! Calling exiftool via Lua is also a great idea.

2 Likes

You can use exiftool to write to xmp files directly: Metadata Sidecar Files