|
3 | 3 |
|
4 | 4 | copyright (c) 2014 Wolfgang Goetz
|
5 | 5 | copyright (c) 2015 Christian Kanzian
|
| 6 | + copyright (c) 2015 Tobias Jakobs |
6 | 7 |
|
7 | 8 | darktable is free software: you can redistribute it and/or modify
|
8 | 9 | it under the terms of the GNU General Public License as published by
|
@@ -40,18 +41,35 @@ dt.configuration.check_version(...,{2,0,0})
|
40 | 41 | -- Register
|
41 | 42 | dt.register_storage("module_hugin", "Hugin panorama", show_status, create_panorama, nil, nil)
|
42 | 43 |
|
| 44 | +local function checkIfBinExists(bin) |
| 45 | + local handle = io.popen("which "..bin) |
| 46 | + local result = handle:read() |
| 47 | + local ret |
| 48 | + handle:close() |
| 49 | + if (not result) then |
| 50 | + dt.print_error(bin.." not found") |
| 51 | + ret = false |
| 52 | + end |
| 53 | + ret = true |
| 54 | + return ret |
| 55 | +end |
| 56 | + |
43 | 57 | local function show_status(storage, image, format, filename,
|
44 | 58 | number, total, high_quality, extra_data)
|
45 | 59 | dt.print("Export to hugin "..tostring(number).."/"..tostring(total))
|
46 | 60 | end
|
47 | 61 |
|
48 | 62 | local function create_panorama(storage, image_table, extra_data) --finalize
|
| 63 | + if not checkIfBinExists("hugin") then |
| 64 | + return |
| 65 | + end |
| 66 | + |
49 | 67 | -- list of exported images
|
50 | 68 | local img_list
|
51 | 69 |
|
52 | 70 | -- reset and create image list
|
53 | 71 | img_list = ""
|
54 |
| - |
| 72 | + |
55 | 73 | for _,v in pairs(image_table) do
|
56 | 74 | img_list = img_list ..v.. " "
|
57 | 75 | end
|
|
0 commit comments