For certain actions darktable creates auto tags—as described here. Is there a way to create custom automatic tags?
I’d like to create a set of automatic tags for aspect ratio (e.g. darktable|aspect|4:3 or darktable|aspect|3:2) orientation (e.g. darktable|orientation|landscape or darktable|orientation|portrait) and other stuff (colored vs grey scale, etc). Is it possible to hook somewhere in to create that tags automatically?
Is types.dt_lua_image_t.get_tags just a link to the get_tags function? I thought it could be called without passing an dt_lua_image_t because that’s done automatically—same for attach/detach_tag.
Is the dt_lua_image_t passed by the events.intermediate-export-image event a reference to the original image? It has the same width and height for every export regardless the settings in crop and rotate. I thought, it would have the dimensions after cropping. If there is no way to get that data, there is no way to set the actual aspect ratio accordingly.
Example:
local function add_tags(event, image, filename, format, storage)
-- Won't work (bad argument)
-- dt_img_tags = image.get_tags()
dt_img_tags = image.get_tags(image) -- <- seems kind of redundant to me
-- Prints size of the raw image
print(image.width)
print(image.height)
end
dt.register_event("intermediate-export-image",add_tags)