Merge pull request #22 from spaceChRiS/import-filters-fix

Take care for code in for loop to be run even for the last image.
This commit is contained in:
houz
2016-01-04 17:23:33 +01:00

View File

@@ -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("^.*[.]")
@@ -74,6 +75,7 @@ dt.register_import_filter("prefer raw over jpeg", function(event, images)
end
end
table.remove(images)
end)
-- vim: shiftwidth=2 expandtab tabstop=2 cindent