From 45ec7b082724f08a19cd5ddfa0b6c4173b54fcce Mon Sep 17 00:00:00 2001 From: marco44 Date: Wed, 11 Feb 2015 15:03:23 +0100 Subject: [PATCH] Correct problem with event on post-import-image --- contrib/autostyle.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/autostyle.lua b/contrib/autostyle.lua index d8086a5..6ffc4a6 100644 --- a/contrib/autostyle.lua +++ b/contrib/autostyle.lua @@ -38,11 +38,16 @@ local darktable = require "darktable" -- Forward declare the functions -local autostyle_apply_one_image,autostyle_apply,exiftool_attribute,capture +local autostyle_apply_one_image,autostyle_apply_one_image_event,autostyle_apply,exiftool_attribute,capture -- Tested it with darktable 1.6.1 and darktable git from 2014-01-25 darktable.configuration.check_version(...,{2,0,2},{2,1,0}) +-- Receive the event triggered +function autostyle_apply_one_image_event(event,image) + autostyle_apply_one_image(image) +end + -- Apply the style to an image, if it matches the tag condition function autostyle_apply_one_image (image) -- We need the tag, the value and the style_name provided from the configuration string @@ -125,6 +130,6 @@ darktable.register_event("shortcut",autostyle_apply, darktable.preferences.register("autostyle","exif_tag","string","Autostyle: EXIF_tag=value=>style","apply a style automatically if an EXIF_tag matches value. Find the tag with exiftool","") -darktable.register_event("post-import-image",autostyle_apply_one_image) +darktable.register_event("post-import-image",autostyle_apply_one_image_event)