From 27ccd764678deb6fe2803d81c2492a7448c4e811 Mon Sep 17 00:00:00 2001 From: chrik5 Date: Fri, 31 Jul 2015 21:45:21 +0200 Subject: [PATCH 1/2] Add new storage hugin panorama export --- contrib/hugin.lua | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 contrib/hugin.lua diff --git a/contrib/hugin.lua b/contrib/hugin.lua new file mode 100644 index 0000000..38fb6ec --- /dev/null +++ b/contrib/hugin.lua @@ -0,0 +1,66 @@ +--[[ + Hugin storage for darktable + + copyright (c) 2014 Wolfgang Goetz + copyright (c) 2015 Christian Kanzian + + darktable is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + darktable is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with darktable. If not, see . +]] + +--[[ +HUGIN +Add a new storage option to send images to hugin. +Images are exported to darktable tmp dir first. + +USAGE +* require this file from your main luarc config file. + +This plugin will add a new storage option and calls hugin after export. +]] + +dt = require "darktable" + +-- should work with lua version 2.0.0 +dt.configuration.check_version(...,{2,0,0}) + +-- list of exported images +local img_list + +dt.register_storage("module_hugin","Hugin panorama", + function(storage, image, format, filename, + number,total,high_quality,extra_data) + dt.print("Export to hugin " .. tostring(number).."/"..tostring(total)) + end, + function(storage,image_table,extra_data) --finalize + -- reset and create image list + img_list = "" + + for _,v in pairs(image_table) do + img_list = img_list ..v.. " " + end + + dt.print("Will try to stitch now") + + if coroutine.yield("RUN_COMMAND","hugin "..img_list) + then + dt.print("Command hugin failed ...") + end + + end, + nil, + nil +) + +-- +-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua From 3033c52ff4247b01e0e30c3ce76d5b79e69d5df5 Mon Sep 17 00:00:00 2001 From: supertobi Date: Tue, 8 Sep 2015 15:21:43 +0200 Subject: [PATCH 2/2] Three small fixes (komments and avoid having a global variable) - a comment about needing hugin installed - it's not the lua version that we check, it's the DT API version - declare "local img_list" here, and avoid having a global variable --- contrib/hugin.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/hugin.lua b/contrib/hugin.lua index 38fb6ec..95c0aa5 100644 --- a/contrib/hugin.lua +++ b/contrib/hugin.lua @@ -23,6 +23,9 @@ HUGIN Add a new storage option to send images to hugin. Images are exported to darktable tmp dir first. +ADDITIANAL SOFTWARE NEEDED FOR THIS SCRIPT +* hugin + USAGE * require this file from your main luarc config file. @@ -31,18 +34,18 @@ This plugin will add a new storage option and calls hugin after export. dt = require "darktable" --- should work with lua version 2.0.0 +-- should work with darktable API version 2.0.0 dt.configuration.check_version(...,{2,0,0}) --- list of exported images -local img_list - dt.register_storage("module_hugin","Hugin panorama", function(storage, image, format, filename, number,total,high_quality,extra_data) dt.print("Export to hugin " .. tostring(number).."/"..tostring(total)) end, function(storage,image_table,extra_data) --finalize + -- list of exported images + local img_list + -- reset and create image list img_list = ""