enfuse: convert raws to tiff automatically

it uses darktable-cli (if installed) to convert to a temporary file the
raw files that enfuse is not able to process.
This commit is contained in:
luca
2019-01-06 21:42:49 +01:00
parent b7ff1cd579
commit e05e05d866

View File

@@ -49,6 +49,7 @@ end
-- add a new lib
-- is enfuse installed?
local enfuse_installed = df.check_if_bin_exists("enfuse")
local darktable_cli_installed = df.check_if_bin_exists("darktable-cli")
-- check the version so that we can use the correct arguments
@@ -149,6 +150,14 @@ dt.register_lib(
cnt = cnt + 1
f:write(i.path.."/"..i.filename.."\n")
target_dir = i.path
elseif i.is_raw and darktable_cli_installed then
local tmp_exported = os.tmpname()..".tif"
os.execute("darktable-cli \""..i.path.."/"..i.filename.."\" \""..tmp_exported.."\"")
dt.print("Raw file "..i.filename.." automatically converted to tiff")
cnt = cnt + 1
f:write(tmp_exported.."\n")
target_dir = i.path
else
dt.print("skipping "..i.filename)
n_skipped = n_skipped + 1