Access Additional Metadata Tags from Lua

Hello

Does anyone know if it’s possible to access the additional metadata tags that can now be added to an image from a Lua script?

Background - I volunteer for local wildlife organisations and survey my local beaches for marine wildlife - I store the photos I take in Darktable. I add keywords for the species and then via Lua link out to https://www.marinespecies.org/ get their taxon ID. I then export observation details to an external DB, but I’d like to store that ID in the Darwin Core taxon fields - which are now available in Darktable (thank you!!) - Xmp.dwc.taxonID etc.

I’ve added this field to the metadata editor module and would like to populate it from my Lua script.

It looks like darktable.gui.libs.metadata and darktable.gui.libs.metadata_view may be helpful but I’m not sure where to begin - help gratefully received!

Thanks

They are simply tags, so you can just attach them. The other metadata fields are also accessible from Lua.

https://docs.darktable.org/lua/stable/lua.api.manual/types/dt_lua_image_t/

1 Like

Thank you! I hadn’t realised it was going to be as simple as image.taxonID = nnnnn

1 Like