Skip to content

Commit 5909765

Browse files
committed
Merge pull request darktable-org#2 from chrik5/master
Add new storage hugin panorama export
2 parents fdc484e + 27ccd76 commit 5909765

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

contrib/hugin.lua

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
--[[
2+
Hugin storage for darktable
3+
4+
copyright (c) 2014 Wolfgang Goetz
5+
copyright (c) 2015 Christian Kanzian
6+
7+
darktable is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation, either version 3 of the License, or
10+
(at your option) any later version.
11+
12+
darktable is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU General Public License
18+
along with darktable. If not, see <http://www.gnu.org/licenses/>.
19+
]]
20+
21+
--[[
22+
HUGIN
23+
Add a new storage option to send images to hugin.
24+
Images are exported to darktable tmp dir first.
25+
26+
USAGE
27+
* require this file from your main luarc config file.
28+
29+
This plugin will add a new storage option and calls hugin after export.
30+
]]
31+
32+
dt = require "darktable"
33+
34+
-- should work with lua version 2.0.0
35+
dt.configuration.check_version(...,{2,0,0})
36+
37+
-- list of exported images
38+
local img_list
39+
40+
dt.register_storage("module_hugin","Hugin panorama",
41+
function(storage, image, format, filename,
42+
number,total,high_quality,extra_data)
43+
dt.print("Export to hugin " .. tostring(number).."/"..tostring(total))
44+
end,
45+
function(storage,image_table,extra_data) --finalize
46+
-- reset and create image list
47+
img_list = ""
48+
49+
for _,v in pairs(image_table) do
50+
img_list = img_list ..v.. " "
51+
end
52+
53+
dt.print("Will try to stitch now")
54+
55+
if coroutine.yield("RUN_COMMAND","hugin "..img_list)
56+
then
57+
dt.print("Command hugin failed ...")
58+
end
59+
60+
end,
61+
nil,
62+
nil
63+
)
64+
65+
--
66+
-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua

0 commit comments

Comments
 (0)