From 39531eb4f0a0b4cb2d69c18a23d69d2eee097519 Mon Sep 17 00:00:00 2001 From: spaceChRiS Date: Sun, 3 Jan 2016 10:44:14 +0100 Subject: [PATCH] Take care for code in for loop to be run even for the last image. The problem: If the last image is a jpeg/raw pair, the code to remove the jpeg from the import list is not run since it is the last image. This is solved by adding an empty line to the images array. It will be counted as new base and therefore the jpeg removal code will be run one more time. I don't know if this is a good solution but I think it solves the problem without adding complexity. --- official/import_filters.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/official/import_filters.lua b/official/import_filters.lua index 5980a72..04a8d5c 100644 --- a/official/import_filters.lua +++ b/official/import_filters.lua @@ -50,6 +50,7 @@ dt.register_import_filter("prefer raw over jpeg", function(event, images) local current_base = "" local jpg_indices = {} local other_format_found = false + table.insert(images, "") for i, img in ipairs(images) do local extension = img:match("[^.]*$"):upper() local base = img:match("^.*[.]")