@@ -60,6 +60,9 @@ local PS <const> = dt.configuration.running_os == "windows" and "\\" or "/"
60
60
-- command separator
61
61
local CS <const> = dt .configuration .running_os == " windows" and " &" or " ;"
62
62
63
+ -- tag name for changed images
64
+ local changed_tag_name = " darktable|changed"
65
+
63
66
-- - - - - - - - - - - - - - - - - - - - - - - -
64
67
-- A P I C H E C K
65
68
-- - - - - - - - - - - - - - - - - - - - - - - -
@@ -313,7 +316,7 @@ local function normalize_maker(maker)
313
316
return maker
314
317
end
315
318
316
- local function has_style_tag (image , tag_name )
319
+ local function has_tag (image , tag_name )
317
320
318
321
local log_level = set_log_level (acs .log_level )
319
322
@@ -387,11 +390,19 @@ local function apply_style_to_images(images)
387
390
for i , pattern in ipairs (acs .styles [maker ].patterns ) do
388
391
if string.match (model , pattern ) or
389
392
(i == # acs .styles [maker ].patterns and string.match (pattern , " generic" )) then
390
- local tag_name = " darktable|style|" .. acs .styles [maker ].styles [i ].name
391
- if not has_style_tag (image , tag_name ) then
393
+ local style_tag_name = " darktable|style|" .. acs .styles [maker ].styles [i ].name
394
+ if not has_tag (image , style_tag_name ) then
395
+ local already_changed = has_tag (image , changed_tag_name )
392
396
image :apply_style (acs .styles [maker ].styles [i ])
393
397
no_match = false
394
398
log .msg (log .info , " applied style " .. acs .styles [maker ].styles [i ].name .. " to " .. image .filename )
399
+ if not already_changed then
400
+ local ct = dt .tags .find (changed_tag_name )
401
+ if ct then
402
+ log .msg (log .debug , " detaching tag " .. changed_tag_name .. " from image " .. image .filename )
403
+ image :detach_tag (ct )
404
+ end
405
+ end
395
406
end
396
407
log .log_level (loglevel )
397
408
break
0 commit comments