Added system library to handle running external commands on different operating systems in a transparent manner. Added file and path quoting that is cross platform compatible. Changed gimp.lua to use the new utilities.
This commit is contained in:
@@ -65,6 +65,7 @@
|
||||
|
||||
local dt = require "darktable"
|
||||
local df = require "lib/dtutils.file"
|
||||
local dtsys = require "lib/dtutils.system"
|
||||
require "official/yield"
|
||||
local gettext = dt.gettext
|
||||
local gimp_widget = nil
|
||||
@@ -94,7 +95,7 @@ local function group_if_not_member(img, new_img)
|
||||
dt.print_log("Added to group")
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
local function sanitize_filename(filepath)
|
||||
local path = df.get_path(filepath)
|
||||
local basename = df.get_basename(filepath)
|
||||
@@ -104,7 +105,7 @@ local function sanitize_filename(filepath)
|
||||
|
||||
return path .. sanitized .. "." .. filetype
|
||||
end
|
||||
|
||||
]]
|
||||
local function show_status(storage, image, format, filename,
|
||||
number, total, high_quality, extra_data)
|
||||
dt.print(string.format(_("Export Image %i/%i"), number, total))
|
||||
@@ -130,7 +131,7 @@ local function gimp_edit(storage, image_table, extra_data) --finalize
|
||||
img_list = ""
|
||||
|
||||
for _,exp_img in pairs(image_table) do
|
||||
exp_img = sanitize_filename(exp_img)
|
||||
exp_img = df.sanitize_filename(exp_img)
|
||||
img_list = img_list ..exp_img.. " "
|
||||
end
|
||||
|
||||
@@ -141,7 +142,7 @@ local function gimp_edit(storage, image_table, extra_data) --finalize
|
||||
|
||||
dt.print_log(gimpStartCommand)
|
||||
|
||||
dt.control.execute( gimpStartCommand)
|
||||
dtsys.external_command(gimpStartCommand)
|
||||
|
||||
-- for each of the image, exported image pairs
|
||||
-- move the exported image into the directory with the original
|
||||
|
||||
Reference in New Issue
Block a user