@@ -46,7 +46,7 @@ dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
|||||||
|
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("clear_GPS",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("clear_GPS",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("clear_GPS", msgid)
|
return gettext.dgettext("clear_GPS", msgid)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ local gettext = dt.gettext
|
|||||||
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0})
|
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("copy_attach_detach_tags",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("copy_attach_detach_tags",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("copy_attach_detach_tags", msgid)
|
return gettext.dgettext("copy_attach_detach_tags", msgid)
|
||||||
@@ -74,7 +74,7 @@ local function mcopy_tags()
|
|||||||
|
|
||||||
--remove duplicate and 'darktable|' tags create final image_tags
|
--remove duplicate and 'darktable|' tags create final image_tags
|
||||||
for _,k in ipairs(tag_list_tmp) do
|
for _,k in ipairs(tag_list_tmp) do
|
||||||
|
|
||||||
if not string.match(tostring(k), 'darktable|') then
|
if not string.match(tostring(k), 'darktable|') then
|
||||||
if not hash[k] then
|
if not hash[k] then
|
||||||
image_tags[#image_tags+1] = k
|
image_tags[#image_tags+1] = k
|
||||||
@@ -85,36 +85,36 @@ local function mcopy_tags()
|
|||||||
|
|
||||||
dt.print(_('Image tags copied ...'))
|
dt.print(_('Image tags copied ...'))
|
||||||
|
|
||||||
--create UI tag list
|
--create UI tag list
|
||||||
local taglist = ""
|
local taglist = ""
|
||||||
|
|
||||||
for _,tag in ipairs(image_tags) do
|
for _,tag in ipairs(image_tags) do
|
||||||
if taglist == "" then
|
if taglist == "" then
|
||||||
taglist = tostring(tag)
|
taglist = tostring(tag)
|
||||||
else
|
else
|
||||||
taglist = taglist.."\n"..tostring(tag)
|
taglist = taglist.."\n"..tostring(tag)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
taglist_label.label = taglist
|
taglist_label.label = taglist
|
||||||
|
|
||||||
return(image_tags)
|
return(image_tags)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- attach copied tags to all selected images
|
-- attach copied tags to all selected images
|
||||||
local function attach_tags()
|
local function attach_tags()
|
||||||
|
|
||||||
if next(image_tags) == nil then
|
if next(image_tags) == nil then
|
||||||
dt.print(_('No tags to attached, please copy tags first.'))
|
dt.print(_('No tags to attached, please copy tags first.'))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local sel_images = dt.gui.action_images
|
local sel_images = dt.gui.action_images
|
||||||
|
|
||||||
for _,image in ipairs(sel_images) do
|
for _,image in ipairs(sel_images) do
|
||||||
local present_image_tags = {}
|
local present_image_tags = {}
|
||||||
present_image_tags = dt.tags.get_tags(image)
|
present_image_tags = dt.tags.get_tags(image)
|
||||||
|
|
||||||
for _,ct in ipairs(image_tags) do
|
for _,ct in ipairs(image_tags) do
|
||||||
-- check if image has tags and attach
|
-- check if image has tags and attach
|
||||||
if next(present_image_tags) == nil then
|
if next(present_image_tags) == nil then
|
||||||
@@ -138,7 +138,7 @@ local function detach_tags()
|
|||||||
for _,image in ipairs(sel_images) do
|
for _,image in ipairs(sel_images) do
|
||||||
local present_image_tags = {}
|
local present_image_tags = {}
|
||||||
present_image_tags = dt.tags.get_tags(image)
|
present_image_tags = dt.tags.get_tags(image)
|
||||||
|
|
||||||
for _,present_tag in ipairs(present_image_tags) do
|
for _,present_tag in ipairs(present_image_tags) do
|
||||||
if not string.match(tostring(present_tag), 'darktable|') then
|
if not string.match(tostring(present_tag), 'darktable|') then
|
||||||
dt.tags.detach(present_tag,image)
|
dt.tags.detach(present_tag,image)
|
||||||
|
|||||||
@@ -31,15 +31,15 @@ USAGE
|
|||||||
* require this script from your main Lua file
|
* require this script from your main Lua file
|
||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local dt = require "darktable"
|
local dt = require "darktable"
|
||||||
require "official/yield"
|
require "official/yield"
|
||||||
|
|
||||||
local gettext = dt.gettext
|
local gettext = dt.gettext
|
||||||
dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("geoJSON_export",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("geoJSON_export",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("geoJSON_export", msgid)
|
return gettext.dgettext("geoJSON_export", msgid)
|
||||||
@@ -52,7 +52,7 @@ local function spairs(_table, order) -- Code copied from http://stackoverflow.co
|
|||||||
for _key in pairs(_table) do keys[#keys + 1] = _key end
|
for _key in pairs(_table) do keys[#keys + 1] = _key end
|
||||||
|
|
||||||
-- if order function given, sort by it by passing the table and keys a, b,
|
-- if order function given, sort by it by passing the table and keys a, b,
|
||||||
-- otherwise just sort the keys
|
-- otherwise just sort the keys
|
||||||
if order then
|
if order then
|
||||||
table.sort(keys, function(a,b) return order(_table, a, b) end)
|
table.sort(keys, function(a,b) return order(_table, a, b) end)
|
||||||
else
|
else
|
||||||
@@ -108,20 +108,20 @@ local function create_geoJSON_file(storage, image_table, extra_data)
|
|||||||
-- Creates dir if not exsists
|
-- Creates dir if not exsists
|
||||||
local imageFoldername = "files/"
|
local imageFoldername = "files/"
|
||||||
local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername
|
local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername
|
||||||
dt.control.execute( mkdirCommand)
|
dt.control.execute( mkdirCommand)
|
||||||
|
|
||||||
-- Create the thumbnails
|
-- Create the thumbnails
|
||||||
for image,exported_image in pairs(image_table) do
|
for image,exported_image in pairs(image_table) do
|
||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
local path, filename, filetype = string.match(image, "(.-)([^\\/]-%.?([^%.\\/]*))$")
|
local path, filename, filetype = string.match(image, "(.-)([^\\/]-%.?([^%.\\/]*))$")
|
||||||
filename = string.upper(string.gsub(filename,"%.", "_"))
|
filename = string.upper(string.gsub(filename,"%.", "_"))
|
||||||
|
|
||||||
-- convert -size 92x92 filename.jpg -resize 92x92 +profile "*" thumbnail.jpg
|
-- convert -size 92x92 filename.jpg -resize 92x92 +profile "*" thumbnail.jpg
|
||||||
-- In this example, '-size 120x120' gives a hint to the JPEG decoder that the image is going to be downscaled to
|
-- In this example, '-size 120x120' gives a hint to the JPEG decoder that the image is going to be downscaled to
|
||||||
-- 120x120, allowing it to run faster by avoiding returning full-resolution images to GraphicsMagick for the
|
-- 120x120, allowing it to run faster by avoiding returning full-resolution images to GraphicsMagick for the
|
||||||
-- subsequent resizing operation. The '-resize 120x120' specifies the desired dimensions of the output image. It
|
-- subsequent resizing operation. The '-resize 120x120' specifies the desired dimensions of the output image. It
|
||||||
-- will be scaled so its largest dimension is 120 pixels. The '+profile "*"' removes any ICM, EXIF, IPTC, or other
|
-- will be scaled so its largest dimension is 120 pixels. The '+profile "*"' removes any ICM, EXIF, IPTC, or other
|
||||||
-- profiles that might be present in the input and aren't needed in the thumbnail.
|
-- profiles that might be present in the input and aren't needed in the thumbnail.
|
||||||
|
|
||||||
@@ -143,15 +143,15 @@ local function create_geoJSON_file(storage, image_table, extra_data)
|
|||||||
|
|
||||||
-- Create the geoJSON file
|
-- Create the geoJSON file
|
||||||
local geoJSON_file = [[
|
local geoJSON_file = [[
|
||||||
{
|
{
|
||||||
"type": "FeatureCollection",
|
"type": "FeatureCollection",
|
||||||
"features": [
|
"features": [
|
||||||
]]
|
]]
|
||||||
|
|
||||||
for image,exported_image in pairs(image_table) do
|
for image,exported_image in pairs(image_table) do
|
||||||
filename = string.upper(string.gsub(image.filename,"%.", "_"))
|
filename = string.upper(string.gsub(image.filename,"%.", "_"))
|
||||||
|
|
||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
geoJSON_file = geoJSON_file..
|
geoJSON_file = geoJSON_file..
|
||||||
@@ -179,7 +179,7 @@ local function create_geoJSON_file(storage, image_table, extra_data)
|
|||||||
,]]
|
,]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
geoJSON_file = geoJSON_file:sub(0,geoJSON_file:len()-1)
|
geoJSON_file = geoJSON_file:sub(0,geoJSON_file:len()-1)
|
||||||
geoJSON_file = geoJSON_file..
|
geoJSON_file = geoJSON_file..
|
||||||
[[
|
[[
|
||||||
@@ -213,7 +213,7 @@ local function create_geoJSON_file(storage, image_table, extra_data)
|
|||||||
.setView([0,0], 5);
|
.setView([0,0], 5);
|
||||||
|
|
||||||
var myLayer = L.mapbox.featureLayer()
|
var myLayer = L.mapbox.featureLayer()
|
||||||
.loadURL(']]..exportgeoJSONFilename..[[')
|
.loadURL(']]..exportgeoJSONFilename..[[')
|
||||||
.addTo(mapTooltipsJS);
|
.addTo(mapTooltipsJS);
|
||||||
|
|
||||||
// Set a custom icon on each marker based on feature properties.
|
// Set a custom icon on each marker based on feature properties.
|
||||||
@@ -260,7 +260,7 @@ local function create_geoJSON_file(storage, image_table, extra_data)
|
|||||||
var polyline = L.polyline(line, polyline_options).addTo(mapTooltipsJS);
|
var polyline = L.polyline(line, polyline_options).addTo(mapTooltipsJS);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -277,11 +277,11 @@ local function create_geoJSON_file(storage, image_table, extra_data)
|
|||||||
|
|
||||||
dt.print("geoJSON file created in "..exportDirectory)
|
dt.print("geoJSON file created in "..exportDirectory)
|
||||||
|
|
||||||
-- Open the file with the standard programm
|
-- Open the file with the standard programm
|
||||||
if ( dt.preferences.read("geoJSON_export","OpengeoJSONFile","bool") == true ) then
|
if ( dt.preferences.read("geoJSON_export","OpengeoJSONFile","bool") == true ) then
|
||||||
local geoJSONFileOpenCommand
|
local geoJSONFileOpenCommand
|
||||||
geoJSONFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportgeoJSONFilename.."\""
|
geoJSONFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportgeoJSONFilename.."\""
|
||||||
dt.control.execute( geoJSONFileOpenCommand)
|
dt.control.execute( geoJSONFileOpenCommand)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
* require this script from your main lua file
|
* require this script from your main lua file
|
||||||
To do this add this line to the file .config/darktable/luarc:
|
To do this add this line to the file .config/darktable/luarc:
|
||||||
require "geoToolbox"
|
require "geoToolbox"
|
||||||
|
|
||||||
* it creates a new geoToolbox lighttable module
|
* it creates a new geoToolbox lighttable module
|
||||||
@@ -32,7 +32,7 @@ local gettext = dt.gettext
|
|||||||
dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("geoToolbox",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("geoToolbox",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("geoToolbox", msgid)
|
return gettext.dgettext("geoToolbox", msgid)
|
||||||
@@ -44,20 +44,20 @@ labelDistance.label = _("Distance:")
|
|||||||
|
|
||||||
local label_copy_gps_lat = dt.new_widget("check_button")
|
local label_copy_gps_lat = dt.new_widget("check_button")
|
||||||
{
|
{
|
||||||
label = _("latitude:"),
|
label = _("latitude:"),
|
||||||
value = true
|
value = true
|
||||||
}
|
}
|
||||||
local label_copy_gps_lon = dt.new_widget("check_button")
|
local label_copy_gps_lon = dt.new_widget("check_button")
|
||||||
{
|
{
|
||||||
label = _("longitude:"),
|
label = _("longitude:"),
|
||||||
value = true
|
value = true
|
||||||
}
|
}
|
||||||
local label_copy_gps_ele = dt.new_widget("check_button")
|
local label_copy_gps_ele = dt.new_widget("check_button")
|
||||||
{
|
{
|
||||||
label = _("elevation:"),
|
label = _("elevation:"),
|
||||||
value = true
|
value = true
|
||||||
}
|
}
|
||||||
-- </GUI>
|
-- </GUI>
|
||||||
|
|
||||||
local function select_with_gps()
|
local function select_with_gps()
|
||||||
local selection = {}
|
local selection = {}
|
||||||
@@ -107,9 +107,9 @@ function isnan(x) return x ~= x end
|
|||||||
|
|
||||||
-- Function from:
|
-- Function from:
|
||||||
-- https://forums.coronalabs.com/topic/29019-convert-string-to-date/
|
-- https://forums.coronalabs.com/topic/29019-convert-string-to-date/
|
||||||
-- This looks much scarier than it really is. The goal is to turn that string
|
-- This looks much scarier than it really is. The goal is to turn that string
|
||||||
-- into a Unix timestamp (number of seconds since Jan 1, 1970, the standard
|
-- into a Unix timestamp (number of seconds since Jan 1, 1970, the standard
|
||||||
-- used by most systems). So we use the string.match() method to fetch the
|
-- used by most systems). So we use the string.match() method to fetch the
|
||||||
-- various date and time parts into their own variables: xyear, xmonth,etc.
|
-- various date and time parts into their own variables: xyear, xmonth,etc.
|
||||||
function make_time_stamp(dateString)
|
function make_time_stamp(dateString)
|
||||||
local convertedTimestamp
|
local convertedTimestamp
|
||||||
@@ -119,11 +119,11 @@ function make_time_stamp(dateString)
|
|||||||
local xyear, xmonth, xday, xhour, xminute, xseconds = dateString:match(pattern)
|
local xyear, xmonth, xday, xhour, xminute, xseconds = dateString:match(pattern)
|
||||||
--dt.print_error(xyear)
|
--dt.print_error(xyear)
|
||||||
convertedTimestamp = os.time({
|
convertedTimestamp = os.time({
|
||||||
year = xyear,
|
year = xyear,
|
||||||
month = xmonth,
|
month = xmonth,
|
||||||
day = xday,
|
day = xday,
|
||||||
hour = xhour,
|
hour = xhour,
|
||||||
min = xminute,
|
min = xminute,
|
||||||
sec = xseconds})
|
sec = xseconds})
|
||||||
else
|
else
|
||||||
convertedTimestamp = 0
|
convertedTimestamp = 0
|
||||||
@@ -141,7 +141,7 @@ local first_image_date = 0
|
|||||||
local function get_first_coordinate()
|
local function get_first_coordinate()
|
||||||
local sel_images = dt.gui.action_images
|
local sel_images = dt.gui.action_images
|
||||||
|
|
||||||
first_latitude = ''
|
first_latitude = ''
|
||||||
first_longitude = ''
|
first_longitude = ''
|
||||||
first_elevation = ''
|
first_elevation = ''
|
||||||
first_image_date = 0
|
first_image_date = 0
|
||||||
@@ -153,7 +153,7 @@ local function get_first_coordinate()
|
|||||||
image_date = image.exif_datetime_taken
|
image_date = image.exif_datetime_taken
|
||||||
first_have_data = true
|
first_have_data = true
|
||||||
if (image.latitude) then
|
if (image.latitude) then
|
||||||
first_latitude = image.latitude
|
first_latitude = image.latitude
|
||||||
end
|
end
|
||||||
if (image.longitude) then
|
if (image.longitude) then
|
||||||
first_longitude = image.longitude
|
first_longitude = image.longitude
|
||||||
@@ -164,7 +164,7 @@ local function get_first_coordinate()
|
|||||||
if (image.exif_datetime_taken) then
|
if (image.exif_datetime_taken) then
|
||||||
first_image_date = make_time_stamp(image.exif_datetime_taken)
|
first_image_date = make_time_stamp(image.exif_datetime_taken)
|
||||||
--dt.print_error(image.exif_datetime_taken)
|
--dt.print_error(image.exif_datetime_taken)
|
||||||
--dt.print_error(first_image_date)
|
--dt.print_error(first_image_date)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
@@ -180,7 +180,7 @@ local second_image_date = 0
|
|||||||
local function get_second_coordinate()
|
local function get_second_coordinate()
|
||||||
local sel_images = dt.gui.action_images
|
local sel_images = dt.gui.action_images
|
||||||
|
|
||||||
second_latitude = ''
|
second_latitude = ''
|
||||||
second_longitude = ''
|
second_longitude = ''
|
||||||
second_elevation = ''
|
second_elevation = ''
|
||||||
second_image_date = 0
|
second_image_date = 0
|
||||||
@@ -192,7 +192,7 @@ local function get_second_coordinate()
|
|||||||
image_date = image.exif_datetime_taken
|
image_date = image.exif_datetime_taken
|
||||||
second_have_data = true
|
second_have_data = true
|
||||||
if (image.latitude) then
|
if (image.latitude) then
|
||||||
second_latitude = image.latitude
|
second_latitude = image.latitude
|
||||||
end
|
end
|
||||||
if (image.longitude) then
|
if (image.longitude) then
|
||||||
second_longitude = image.longitude
|
second_longitude = image.longitude
|
||||||
@@ -210,7 +210,7 @@ end
|
|||||||
|
|
||||||
local calc_in_between_slider = dt.new_widget("slider")
|
local calc_in_between_slider = dt.new_widget("slider")
|
||||||
{
|
{
|
||||||
label = "Position between",
|
label = "Position between",
|
||||||
soft_min = 0, -- The soft minimum value for the slider, the slider can't go beyond this point
|
soft_min = 0, -- The soft minimum value for the slider, the slider can't go beyond this point
|
||||||
soft_max = 100, -- The soft maximum value for the slider, the slider can't go beyond this point
|
soft_max = 100, -- The soft maximum value for the slider, the slider can't go beyond this point
|
||||||
hard_min = -100, -- The hard minimum value for the slider, the user can't manually enter a value beyond this point
|
hard_min = -100, -- The hard minimum value for the slider, the user can't manually enter a value beyond this point
|
||||||
@@ -234,7 +234,7 @@ local function calc_in_between()
|
|||||||
percent_in_between = 1
|
percent_in_between = 1
|
||||||
else
|
else
|
||||||
percent_in_between = image_date_new/end_new
|
percent_in_between = image_date_new/end_new
|
||||||
end
|
end
|
||||||
calc_in_between_slider.value = percent_in_between * 100
|
calc_in_between_slider.value = percent_in_between * 100
|
||||||
dt.print_error(percent_in_between)
|
dt.print_error(percent_in_between)
|
||||||
local in_between_latitude = first_latitude + (second_latitude - first_latitude) * percent_in_between
|
local in_between_latitude = first_latitude + (second_latitude - first_latitude) * percent_in_between
|
||||||
@@ -264,7 +264,7 @@ local copy_gps_elevation = ''
|
|||||||
local function copy_gps()
|
local function copy_gps()
|
||||||
local sel_images = dt.gui.action_images
|
local sel_images = dt.gui.action_images
|
||||||
|
|
||||||
copy_gps_latitude = ''
|
copy_gps_latitude = ''
|
||||||
copy_gps_longitude = ''
|
copy_gps_longitude = ''
|
||||||
copy_gps_elevation = ''
|
copy_gps_elevation = ''
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ local function copy_gps()
|
|||||||
else
|
else
|
||||||
copy_gps_have_data = true
|
copy_gps_have_data = true
|
||||||
if (image.latitude and label_copy_gps_lat.value) then
|
if (image.latitude and label_copy_gps_lat.value) then
|
||||||
copy_gps_latitude = image.latitude
|
copy_gps_latitude = image.latitude
|
||||||
end
|
end
|
||||||
if (image.longitude and label_copy_gps_lon.value) then
|
if (image.longitude and label_copy_gps_lon.value) then
|
||||||
copy_gps_longitude = image.longitude
|
copy_gps_longitude = image.longitude
|
||||||
@@ -299,7 +299,7 @@ local function paste_gps(image)
|
|||||||
if (label_copy_gps_lat.value) then
|
if (label_copy_gps_lat.value) then
|
||||||
image.latitude = copy_gps_latitude
|
image.latitude = copy_gps_latitude
|
||||||
end
|
end
|
||||||
if (label_copy_gps_lon.value) then
|
if (label_copy_gps_lon.value) then
|
||||||
image.longitude = copy_gps_longitude
|
image.longitude = copy_gps_longitude
|
||||||
end
|
end
|
||||||
if (label_copy_gps_ele.value) then
|
if (label_copy_gps_ele.value) then
|
||||||
@@ -313,17 +313,17 @@ local function open_location_in_gnome_maps()
|
|||||||
if not df.check_if_bin_exists("gnome-maps") then
|
if not df.check_if_bin_exists("gnome-maps") then
|
||||||
dt.print_error(_("gnome-maps not found"))
|
dt.print_error(_("gnome-maps not found"))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local sel_images = dt.gui.action_images
|
local sel_images = dt.gui.action_images
|
||||||
|
|
||||||
local lat1 = 0;
|
local lat1 = 0;
|
||||||
local lon1 = 0;
|
local lon1 = 0;
|
||||||
local i = 0;
|
local i = 0;
|
||||||
|
|
||||||
-- Use the first image with geo information
|
-- Use the first image with geo information
|
||||||
for _,image in ipairs(sel_images) do
|
for _,image in ipairs(sel_images) do
|
||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
lat1 = image.latitude;
|
lat1 = image.latitude;
|
||||||
@@ -334,7 +334,7 @@ local function open_location_in_gnome_maps()
|
|||||||
local startCommand
|
local startCommand
|
||||||
startCommand = "gnome-maps \"geo:" .. lat1 .. "," .. lon1 .."\""
|
startCommand = "gnome-maps \"geo:" .. lat1 .. "," .. lon1 .."\""
|
||||||
dt.print_error(startCommand)
|
dt.print_error(startCommand)
|
||||||
|
|
||||||
if coroutine.yield("RUN_COMMAND", startCommand) then
|
if coroutine.yield("RUN_COMMAND", startCommand) then
|
||||||
dt.print(_("Command failed ..."))
|
dt.print(_("Command failed ..."))
|
||||||
end
|
end
|
||||||
@@ -350,14 +350,14 @@ local function get_distance(lat1, lon1, ele1, lat2, lon2, ele2)
|
|||||||
|
|
||||||
local earthRadius = 6371; -- Radius of the earth in km
|
local earthRadius = 6371; -- Radius of the earth in km
|
||||||
local dLat = math.rad(lat2-lat1); -- deg2rad below
|
local dLat = math.rad(lat2-lat1); -- deg2rad below
|
||||||
local dLon = math.rad(lon2-lon1);
|
local dLon = math.rad(lon2-lon1);
|
||||||
local a =
|
local a =
|
||||||
math.sin(dLat/2) * math.sin(dLat/2) +
|
math.sin(dLat/2) * math.sin(dLat/2) +
|
||||||
math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) *
|
math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) *
|
||||||
math.sin(dLon/2) * math.sin(dLon/2)
|
math.sin(dLon/2) * math.sin(dLon/2)
|
||||||
;
|
;
|
||||||
local angle = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a));
|
local angle = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a));
|
||||||
local distance = earthRadius * angle; -- Distance in km
|
local distance = earthRadius * angle; -- Distance in km
|
||||||
|
|
||||||
-- Add the elevation to the calculation
|
-- Add the elevation to the calculation
|
||||||
local elevation = 0
|
local elevation = 0
|
||||||
@@ -385,9 +385,9 @@ local function calc_distance()
|
|||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
|
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
|
|
||||||
if (i == 1) then
|
if (i == 1) then
|
||||||
lat1 = image.latitude
|
lat1 = image.latitude
|
||||||
lon1 = image.longitude
|
lon1 = image.longitude
|
||||||
@@ -397,7 +397,7 @@ local function calc_distance()
|
|||||||
ele1 = 0
|
ele1 = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
lat2 = image.latitude
|
lat2 = image.latitude
|
||||||
lon2 = image.longitude
|
lon2 = image.longitude
|
||||||
if (image.elevation) then
|
if (image.elevation) then
|
||||||
@@ -417,7 +417,7 @@ local function calc_distance()
|
|||||||
else
|
else
|
||||||
distanceUnit = _("km")
|
distanceUnit = _("km")
|
||||||
end
|
end
|
||||||
|
|
||||||
return string.format(_("Distance: %.2f %s"), distance, distanceUnit)
|
return string.format(_("Distance: %.2f %s"), distance, distanceUnit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ local altitude_file_chooser_button = dt.new_widget("file_chooser_button")
|
|||||||
}
|
}
|
||||||
local altitude_filename = dt.new_widget("entry")
|
local altitude_filename = dt.new_widget("entry")
|
||||||
{
|
{
|
||||||
text = "altitude.csv",
|
text = "altitude.csv",
|
||||||
placeholder = "altitude.csv",
|
placeholder = "altitude.csv",
|
||||||
editable = true,
|
editable = true,
|
||||||
tooltip = _("Name of the exported file"),
|
tooltip = _("Name of the exported file"),
|
||||||
@@ -465,12 +465,12 @@ local function altitude_profile()
|
|||||||
|
|
||||||
local sel_images = dt.gui.action_images
|
local sel_images = dt.gui.action_images
|
||||||
for _,image in ipairs(sel_images) do
|
for _,image in ipairs(sel_images) do
|
||||||
if ((not isnan(image.longitude) and not isnan(image.latitude) and not isnan(image.elevation) and image.elevation) and
|
if ((not isnan(image.longitude) and not isnan(image.latitude) and not isnan(image.elevation) and image.elevation) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
|
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
|
|
||||||
if (i == 1) then
|
if (i == 1) then
|
||||||
lat1 = image.latitude
|
lat1 = image.latitude
|
||||||
lon1 = image.longitude
|
lon1 = image.longitude
|
||||||
@@ -480,7 +480,7 @@ local function altitude_profile()
|
|||||||
lon1 = lon2
|
lon1 = lon2
|
||||||
ele1 = ele2
|
ele1 = ele2
|
||||||
end
|
end
|
||||||
|
|
||||||
lat2 = image.latitude
|
lat2 = image.latitude
|
||||||
lon2 = image.longitude
|
lon2 = image.longitude
|
||||||
ele2 = image.elevation
|
ele2 = image.elevation
|
||||||
@@ -576,7 +576,7 @@ dt.register_lib(
|
|||||||
},
|
},
|
||||||
calc_in_between_slider,
|
calc_in_between_slider,
|
||||||
separator3,--------------------------------------------------------
|
separator3,--------------------------------------------------------
|
||||||
]]
|
]]
|
||||||
dt.new_widget("button")
|
dt.new_widget("button")
|
||||||
{
|
{
|
||||||
label = _("open in Gnome Maps"),
|
label = _("open in Gnome Maps"),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Copyright (C) 2016 Bill Ferguson <wpferguson@gmail.com>.
|
Copyright (C) 2016 Bill Ferguson <wpferguson@gmail.com>.
|
||||||
|
|
||||||
Portions are lifted from hugin.lua and thus are
|
Portions are lifted from hugin.lua and thus are
|
||||||
|
|
||||||
Copyright (c) 2014 Wolfgang Goetz
|
Copyright (c) 2014 Wolfgang Goetz
|
||||||
Copyright (c) 2015 Christian Kanzian
|
Copyright (c) 2015 Christian Kanzian
|
||||||
@@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
This script provides another storage (export target) for darktable. Selected
|
This script provides another storage (export target) for darktable. Selected
|
||||||
images are exported in the specified format to temporary storage. GIMP is launched
|
images are exported in the specified format to temporary storage. GIMP is launched
|
||||||
and opens the files. After editing, the exported images are overwritten to save the
|
and opens the files. After editing, the exported images are overwritten to save the
|
||||||
changes. When GIMP exits, the exported files are moved into the current collection
|
changes. When GIMP exits, the exported files are moved into the current collection
|
||||||
and imported into the database. The imported files then show up grouped with the
|
and imported into the database. The imported files then show up grouped with the
|
||||||
originally selected images.
|
originally selected images.
|
||||||
|
|
||||||
ADDITIONAL SOFTWARE NEEDED FOR THIS SCRIPT
|
ADDITIONAL SOFTWARE NEEDED FOR THIS SCRIPT
|
||||||
@@ -50,8 +50,8 @@
|
|||||||
CAVEATS
|
CAVEATS
|
||||||
* Developed and tested on Ubuntu 14.04 LTS with darktable 2.0.3 and GIMP 2.9.3 (development version with
|
* Developed and tested on Ubuntu 14.04 LTS with darktable 2.0.3 and GIMP 2.9.3 (development version with
|
||||||
> 8 bit color)
|
> 8 bit color)
|
||||||
* There is no provision for dealing with the xcf files generated by GIMP, since darktable doesn't deal with
|
* There is no provision for dealing with the xcf files generated by GIMP, since darktable doesn't deal with
|
||||||
them. You may want to save the xcf file if you intend on doing further edits to the image or need to save
|
them. You may want to save the xcf file if you intend on doing further edits to the image or need to save
|
||||||
the layers used. Where you save them is up to you.
|
the layers used. Where you save them is up to you.
|
||||||
|
|
||||||
BUGS, COMMENTS, SUGGESTIONS
|
BUGS, COMMENTS, SUGGESTIONS
|
||||||
@@ -71,7 +71,7 @@ local gettext = dt.gettext
|
|||||||
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0})
|
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("gimp",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("gimp",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function split_filepath(str)
|
local function split_filepath(str)
|
||||||
local result = {}
|
local result = {}
|
||||||
@@ -123,11 +123,11 @@ end
|
|||||||
function checkIfFileExists(filepath)
|
function checkIfFileExists(filepath)
|
||||||
local file = io.open(filepath,"r")
|
local file = io.open(filepath,"r")
|
||||||
local ret
|
local ret
|
||||||
if file ~= nil then
|
if file ~= nil then
|
||||||
io.close(file)
|
io.close(file)
|
||||||
dt.print_error("true checkIfFileExists: "..filepath)
|
dt.print_error("true checkIfFileExists: "..filepath)
|
||||||
ret = true
|
ret = true
|
||||||
else
|
else
|
||||||
dt.print_error(filepath.." not found")
|
dt.print_error(filepath.." not found")
|
||||||
ret = false
|
ret = false
|
||||||
end
|
end
|
||||||
@@ -254,7 +254,7 @@ local function gimp_edit(storage, image_table, extra_data) --finalize
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- list of exported images
|
-- list of exported images
|
||||||
local img_list
|
local img_list
|
||||||
|
|
||||||
-- reset and create image list
|
-- reset and create image list
|
||||||
@@ -269,13 +269,13 @@ local function gimp_edit(storage, image_table, extra_data) --finalize
|
|||||||
|
|
||||||
local gimpStartCommand
|
local gimpStartCommand
|
||||||
gimpStartCommand = "gimp "..img_list
|
gimpStartCommand = "gimp "..img_list
|
||||||
|
|
||||||
dt.print_error(gimpStartCommand)
|
dt.print_error(gimpStartCommand)
|
||||||
|
|
||||||
dt.control.execute( gimpStartCommand)
|
dt.control.execute( gimpStartCommand)
|
||||||
|
|
||||||
-- for each of the image, exported image pairs
|
-- for each of the image, exported image pairs
|
||||||
-- move the exported image into the directory with the original
|
-- move the exported image into the directory with the original
|
||||||
-- then import the image into the database which will group it with the original
|
-- then import the image into the database which will group it with the original
|
||||||
-- and then copy over any tags other than darktable tags
|
-- and then copy over any tags other than darktable tags
|
||||||
|
|
||||||
@@ -286,8 +286,8 @@ local function gimp_edit(storage, image_table, extra_data) --finalize
|
|||||||
while checkIfFileExists(myimage_name) do
|
while checkIfFileExists(myimage_name) do
|
||||||
myimage_name = filename_increment(myimage_name)
|
myimage_name = filename_increment(myimage_name)
|
||||||
-- limit to 99 more exports of the original export
|
-- limit to 99 more exports of the original export
|
||||||
if string.match(get_basename(myimage_name), "_(d-)$") == "99" then
|
if string.match(get_basename(myimage_name), "_(d-)$") == "99" then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ local function gimp_edit(storage, image_table, extra_data) --finalize
|
|||||||
|
|
||||||
groupIfNotMember(image, myimage)
|
groupIfNotMember(image, myimage)
|
||||||
|
|
||||||
for _,tag in pairs(dt.tags.get_tags(image)) do
|
for _,tag in pairs(dt.tags.get_tags(image)) do
|
||||||
if not (string.sub(tag.name,1,9) == "darktable") then
|
if not (string.sub(tag.name,1,9) == "darktable") then
|
||||||
dt.print_error("attaching tag")
|
dt.print_error("attaching tag")
|
||||||
dt.tags.attach(tag,myimage)
|
dt.tags.attach(tag,myimage)
|
||||||
@@ -315,5 +315,3 @@ end
|
|||||||
dt.register_storage("module_gimp", _("Edit with GIMP"), show_status, gimp_edit)
|
dt.register_storage("module_gimp", _("Edit with GIMP"), show_status, gimp_edit)
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
--[[
|
--[[
|
||||||
Hugin storage for darktable
|
Hugin storage for darktable
|
||||||
|
|
||||||
copyright (c) 2014 Wolfgang Goetz
|
copyright (c) 2014 Wolfgang Goetz
|
||||||
copyright (c) 2015 Christian Kanzian
|
copyright (c) 2015 Christian Kanzian
|
||||||
copyright (c) 2015 Tobias Jakobs
|
copyright (c) 2015 Tobias Jakobs
|
||||||
|
|
||||||
darktable is free software: you can redistribute it and/or modify
|
darktable is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
darktable is distributed in the hope that it will be useful,
|
darktable is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with darktable. If not, see <http://www.gnu.org/licenses/>.
|
along with darktable. If not, see <http://www.gnu.org/licenses/>.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
HUGIN
|
HUGIN
|
||||||
Add a new storage option to send images to hugin.
|
Add a new storage option to send images to hugin.
|
||||||
Images are exported to darktable tmp dir first.
|
Images are exported to darktable tmp dir first.
|
||||||
|
|
||||||
ADDITIONAL SOFTWARE NEEDED FOR THIS SCRIPT
|
ADDITIONAL SOFTWARE NEEDED FOR THIS SCRIPT
|
||||||
* hugin
|
* hugin
|
||||||
@@ -42,7 +42,7 @@ local gettext = dt.gettext
|
|||||||
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0},{5,0,0})
|
dt.configuration.check_version(...,{2,0,0},{3,0,0},{4,0,0},{5,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("hugin",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("hugin",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("hugin", msgid)
|
return gettext.dgettext("hugin", msgid)
|
||||||
@@ -86,7 +86,7 @@ local function create_panorama(storage, image_table, extra_data) --finalize
|
|||||||
hugin_executor = true
|
hugin_executor = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- list of exported images
|
-- list of exported images
|
||||||
local img_list
|
local img_list
|
||||||
|
|
||||||
-- reset and create image list
|
-- reset and create image list
|
||||||
@@ -112,7 +112,7 @@ local function create_panorama(storage, image_table, extra_data) --finalize
|
|||||||
else
|
else
|
||||||
huginStartCommand = "hugin "..img_list
|
huginStartCommand = "hugin "..img_list
|
||||||
end
|
end
|
||||||
|
|
||||||
dt.print_error(huginStartCommand)
|
dt.print_error(huginStartCommand)
|
||||||
|
|
||||||
if not dt.control.execute(huginStartCommand)
|
if not dt.control.execute(huginStartCommand)
|
||||||
|
|||||||
@@ -35,15 +35,15 @@ USAGE
|
|||||||
* when choosing file format, pick JPEG or PNG as Google Earth doesn't support other formats
|
* when choosing file format, pick JPEG or PNG as Google Earth doesn't support other formats
|
||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local dt = require "darktable"
|
local dt = require "darktable"
|
||||||
require "official/yield"
|
require "official/yield"
|
||||||
|
|
||||||
local gettext = dt.gettext
|
local gettext = dt.gettext
|
||||||
dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
dt.configuration.check_version(...,{3,0,0},{4,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("kml_export",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("kml_export",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("kml_export", msgid)
|
return gettext.dgettext("kml_export", msgid)
|
||||||
@@ -56,7 +56,7 @@ local function spairs(_table, order) -- Code copied from http://stackoverflow.co
|
|||||||
for _key in pairs(_table) do keys[#keys + 1] = _key end
|
for _key in pairs(_table) do keys[#keys + 1] = _key end
|
||||||
|
|
||||||
-- if order function given, sort by it by passing the table and keys a, b,
|
-- if order function given, sort by it by passing the table and keys a, b,
|
||||||
-- otherwise just sort the keys
|
-- otherwise just sort the keys
|
||||||
if order then
|
if order then
|
||||||
table.sort(keys, function(a,b) return order(_table, a, b) end)
|
table.sort(keys, function(a,b) return order(_table, a, b) end)
|
||||||
else
|
else
|
||||||
@@ -89,7 +89,7 @@ local function checkIfBinExists(bin)
|
|||||||
ret = true
|
ret = true
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Strip accents from a string
|
-- Strip accents from a string
|
||||||
-- Copied from https://forums.coronalabs.com/topic/43048-remove-special-characters-from-string/
|
-- Copied from https://forums.coronalabs.com/topic/43048-remove-special-characters-from-string/
|
||||||
function string.stripAccents( str )
|
function string.stripAccents( str )
|
||||||
@@ -145,7 +145,7 @@ function string.stripAccents( str )
|
|||||||
tableAccents["Û"] = "U"
|
tableAccents["Û"] = "U"
|
||||||
tableAccents["Ü"] = "U"
|
tableAccents["Ü"] = "U"
|
||||||
tableAccents["Ý"] = "Y"
|
tableAccents["Ý"] = "Y"
|
||||||
|
|
||||||
local normalizedString = ""
|
local normalizedString = ""
|
||||||
|
|
||||||
for strChar in string.gmatch(str, "([%z\1-\127\194-\244][\128-\191]*)") do
|
for strChar in string.gmatch(str, "([%z\1-\127\194-\244][\128-\191]*)") do
|
||||||
@@ -155,9 +155,9 @@ function string.stripAccents( str )
|
|||||||
normalizedString = normalizedString..strChar
|
normalizedString = normalizedString..strChar
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return normalizedString
|
return normalizedString
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Escape XML characters
|
-- Escape XML characters
|
||||||
@@ -205,22 +205,22 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
-- Creates dir if not exsists
|
-- Creates dir if not exsists
|
||||||
imageFoldername = "files/"
|
imageFoldername = "files/"
|
||||||
local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername
|
local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername
|
||||||
dt.control.execute(mkdirCommand)
|
dt.control.execute(mkdirCommand)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Create the thumbnails
|
-- Create the thumbnails
|
||||||
for image,exported_image in pairs(image_table) do
|
for image,exported_image in pairs(image_table) do
|
||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
local path, filename, filetype = string.match(exported_image, "(.-)([^\\/]-%.?([^%.\\/]*))$")
|
local path, filename, filetype = string.match(exported_image, "(.-)([^\\/]-%.?([^%.\\/]*))$")
|
||||||
filename = string.upper(string.gsub(filename,"%.%w*", ""))
|
filename = string.upper(string.gsub(filename,"%.%w*", ""))
|
||||||
|
|
||||||
-- convert -size 92x92 filename.jpg -resize 92x92 +profile "*" thumbnail.jpg
|
-- convert -size 92x92 filename.jpg -resize 92x92 +profile "*" thumbnail.jpg
|
||||||
-- In this example, '-size 120x120' gives a hint to the JPEG decoder that the image is going to be downscaled to
|
-- In this example, '-size 120x120' gives a hint to the JPEG decoder that the image is going to be downscaled to
|
||||||
-- 120x120, allowing it to run faster by avoiding returning full-resolution images to GraphicsMagick for the
|
-- 120x120, allowing it to run faster by avoiding returning full-resolution images to GraphicsMagick for the
|
||||||
-- subsequent resizing operation. The '-resize 120x120' specifies the desired dimensions of the output image. It
|
-- subsequent resizing operation. The '-resize 120x120' specifies the desired dimensions of the output image. It
|
||||||
-- will be scaled so its largest dimension is 120 pixels. The '+profile "*"' removes any ICM, EXIF, IPTC, or other
|
-- will be scaled so its largest dimension is 120 pixels. The '+profile "*"' removes any ICM, EXIF, IPTC, or other
|
||||||
-- profiles that might be present in the input and aren't needed in the thumbnail.
|
-- profiles that might be present in the input and aren't needed in the thumbnail.
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
|
|
||||||
local pattern = "[/]?([^/]+)$"
|
local pattern = "[/]?([^/]+)$"
|
||||||
filmName = string.match(image.film.path, pattern)
|
filmName = string.match(image.film.path, pattern)
|
||||||
|
|
||||||
-- Strip accents from the filename, because GoogleEarth can't open them
|
-- Strip accents from the filename, because GoogleEarth can't open them
|
||||||
-- https://github.com/darktable-org/lua-scripts/issues/54
|
-- https://github.com/darktable-org/lua-scripts/issues/54
|
||||||
filmName = string.stripAccents(filmName)
|
filmName = string.stripAccents(filmName)
|
||||||
@@ -248,20 +248,20 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
kml_file = kml_file.."<Document>\n"
|
kml_file = kml_file.."<Document>\n"
|
||||||
|
|
||||||
--image_table = dt.gui.selection();
|
--image_table = dt.gui.selection();
|
||||||
kml_file = kml_file.."<name>"..filmName.."</name>\n"
|
kml_file = kml_file.."<name>"..filmName.."</name>\n"
|
||||||
kml_file = kml_file.." <description>Exported from darktable</description>\n"
|
kml_file = kml_file.." <description>Exported from darktable</description>\n"
|
||||||
|
|
||||||
for image,exported_image in pairs(image_table) do
|
for image,exported_image in pairs(image_table) do
|
||||||
-- Extract filename, e.g DSC9784.ARW -> DSC9784
|
-- Extract filename, e.g DSC9784.ARW -> DSC9784
|
||||||
filename = string.upper(string.gsub(image.filename,"%.%w*", ""))
|
filename = string.upper(string.gsub(image.filename,"%.%w*", ""))
|
||||||
-- Extract extension from exported image (user can choose JPG or PNG), e.g DSC9784.JPG -> .JPG
|
-- Extract extension from exported image (user can choose JPG or PNG), e.g DSC9784.JPG -> .JPG
|
||||||
extension = string.match(exported_image,"%.%w*$")
|
extension = string.match(exported_image,"%.%w*$")
|
||||||
|
|
||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
kml_file = kml_file.." <Placemark>\n"
|
kml_file = kml_file.." <Placemark>\n"
|
||||||
|
|
||||||
local image_title, image_description
|
local image_title, image_description
|
||||||
if (image.title and image.title ~= "") then
|
if (image.title and image.title ~= "") then
|
||||||
image_title = string.escapeXmlCharacters(image.title)
|
image_title = string.escapeXmlCharacters(image.title)
|
||||||
@@ -271,12 +271,12 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
-- Characters should not be escaped in CDATA, but we are using HTML fragment, so we must escape them
|
-- Characters should not be escaped in CDATA, but we are using HTML fragment, so we must escape them
|
||||||
image_description = string.escapeXmlCharacters(image.description)
|
image_description = string.escapeXmlCharacters(image.description)
|
||||||
|
|
||||||
kml_file = kml_file.." <name>"..image_title.."</name>\n"
|
kml_file = kml_file.." <name>"..image_title.."</name>\n"
|
||||||
kml_file = kml_file.." <description>"..image_description.."</description>\n"
|
kml_file = kml_file.." <description>"..image_description.."</description>\n"
|
||||||
kml_file = kml_file.." <Style>\n"
|
kml_file = kml_file.." <Style>\n"
|
||||||
kml_file = kml_file.." <IconStyle>\n"
|
kml_file = kml_file.." <IconStyle>\n"
|
||||||
kml_file = kml_file.." <Icon>\n"
|
kml_file = kml_file.." <Icon>\n"
|
||||||
kml_file = kml_file.." <href>"..imageFoldername.."thumb_"..filename..".jpg</href>\n"
|
kml_file = kml_file.." <href>"..imageFoldername.."thumb_"..filename..".jpg</href>\n"
|
||||||
kml_file = kml_file.." </Icon>\n"
|
kml_file = kml_file.." </Icon>\n"
|
||||||
kml_file = kml_file.." </IconStyle>\n"
|
kml_file = kml_file.." </IconStyle>\n"
|
||||||
kml_file = kml_file.." <BalloonStyle>\n"
|
kml_file = kml_file.." <BalloonStyle>\n"
|
||||||
@@ -293,29 +293,29 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
kml_file = kml_file.." <when>"..string.gsub(image.exif_datetime_taken," ", "T").."Z".."</when>\n"
|
kml_file = kml_file.." <when>"..string.gsub(image.exif_datetime_taken," ", "T").."Z".."</when>\n"
|
||||||
kml_file = kml_file.." </TimeStamp>\n"
|
kml_file = kml_file.." </TimeStamp>\n"
|
||||||
kml_file = kml_file.." </Point>\n"
|
kml_file = kml_file.." </Point>\n"
|
||||||
|
|
||||||
kml_file = kml_file.." </Placemark>\n"
|
kml_file = kml_file.." </Placemark>\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Connects all images with an path
|
-- Connects all images with an path
|
||||||
if ( dt.preferences.read("kml_export","CreatePath","bool") == true ) then
|
if ( dt.preferences.read("kml_export","CreatePath","bool") == true ) then
|
||||||
kml_file = kml_file.." <Placemark>\n"
|
kml_file = kml_file.." <Placemark>\n"
|
||||||
kml_file = kml_file.." <name>Path</name>\n" -- ToDo: I think a better name would be nice
|
kml_file = kml_file.." <name>Path</name>\n" -- ToDo: I think a better name would be nice
|
||||||
--kml_file = kml_file.." <description></description>\n"
|
--kml_file = kml_file.." <description></description>\n"
|
||||||
|
|
||||||
kml_file = kml_file.." <Style>\n"
|
kml_file = kml_file.." <Style>\n"
|
||||||
kml_file = kml_file.." <LineStyle>\n"
|
kml_file = kml_file.." <LineStyle>\n"
|
||||||
kml_file = kml_file.." <color>ff0000ff</color>\n"
|
kml_file = kml_file.." <color>ff0000ff</color>\n"
|
||||||
kml_file = kml_file.." <width>5</width>\n"
|
kml_file = kml_file.." <width>5</width>\n"
|
||||||
kml_file = kml_file.." </LineStyle>\n"
|
kml_file = kml_file.." </LineStyle>\n"
|
||||||
kml_file = kml_file.." </Style>\n"
|
kml_file = kml_file.." </Style>\n"
|
||||||
|
|
||||||
kml_file = kml_file.." <LineString>\n"
|
kml_file = kml_file.." <LineString>\n"
|
||||||
kml_file = kml_file.." <coordinates>\n"
|
kml_file = kml_file.." <coordinates>\n"
|
||||||
|
|
||||||
for image,exported_image in spairs(image_table, function(t,a,b) return t[b] < t[a] end) do
|
for image,exported_image in spairs(image_table, function(t,a,b) return t[b] < t[a] end) do
|
||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
local altitude = 0;
|
local altitude = 0;
|
||||||
@@ -349,7 +349,7 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
createKMZCommand = createKMZCommand .."\""..dt.configuration.tmp_dir.."/"..exportKMLFilename.."\" " -- KML file
|
createKMZCommand = createKMZCommand .."\""..dt.configuration.tmp_dir.."/"..exportKMLFilename.."\" " -- KML file
|
||||||
|
|
||||||
for image,exported_image in pairs(image_table) do
|
for image,exported_image in pairs(image_table) do
|
||||||
if ((image.longitude and image.latitude) and
|
if ((image.longitude and image.latitude) and
|
||||||
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
(image.longitude ~= 0 and image.latitude ~= 90) -- Sometimes the north-pole but most likely just wrong data
|
||||||
) then
|
) then
|
||||||
local filename = string.upper(string.gsub(image.filename,"%.%w*", ""))
|
local filename = string.upper(string.gsub(image.filename,"%.%w*", ""))
|
||||||
@@ -362,7 +362,7 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
dt.control.execute(createKMZCommand)
|
dt.control.execute(createKMZCommand)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Open the file with the standard programm
|
-- Open the file with the standard programm
|
||||||
if ( dt.preferences.read("kml_export","OpenKmlFile","bool") == true ) then
|
if ( dt.preferences.read("kml_export","OpenKmlFile","bool") == true ) then
|
||||||
local kmlFileOpenCommand
|
local kmlFileOpenCommand
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ local function create_kml_file(storage, image_table, extra_data)
|
|||||||
else
|
else
|
||||||
kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMLFilename.."\""
|
kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMLFilename.."\""
|
||||||
end
|
end
|
||||||
dt.control.execute(kmlFileOpenCommand)
|
dt.control.execute(kmlFileOpenCommand)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -406,7 +406,7 @@ dt.preferences.register("kml_export",
|
|||||||
"bool",
|
"bool",
|
||||||
_("KML export: Create KMZ file"),
|
_("KML export: Create KMZ file"),
|
||||||
_("Compress all imeges to one KMZ file"),
|
_("Compress all imeges to one KMZ file"),
|
||||||
true )
|
true )
|
||||||
|
|
||||||
-- Register
|
-- Register
|
||||||
dt.register_storage("kml_export", _("KML/KMZ Export"), nil, create_kml_file)
|
dt.register_storage("kml_export", _("KML/KMZ Export"), nil, create_kml_file)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ require "official/yield"
|
|||||||
local gettext = dt.gettext
|
local gettext = dt.gettext
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("pdf_slideshow",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("pdf_slideshow",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("pdf_slideshow", msgid)
|
return gettext.dgettext("pdf_slideshow", msgid)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ local gettext = dt.gettext
|
|||||||
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0})
|
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("quicktag",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("quicktag",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("quicktag", msgid)
|
return gettext.dgettext("quicktag", msgid)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ You need rhythmbox-client installed to use this script
|
|||||||
USAGE
|
USAGE
|
||||||
* require this script from your main lua file
|
* require this script from your main lua file
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local dt = require "darktable"
|
local dt = require "darktable"
|
||||||
require "official/yield"
|
require "official/yield"
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ local gettext = dt.gettext
|
|||||||
dt.configuration.check_version(...,{2,0,2},{3,0,0},{4,0,0})
|
dt.configuration.check_version(...,{2,0,2},{3,0,0},{4,0,0})
|
||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
gettext.bindtextdomain("slideshowMusic",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("slideshowMusic",dt.configuration.config_dir.."/lua/locale/")
|
||||||
|
|
||||||
local function _(msgid)
|
local function _(msgid)
|
||||||
return gettext.dgettext("slideshowMusic", msgid)
|
return gettext.dgettext("slideshowMusic", msgid)
|
||||||
@@ -65,14 +65,14 @@ local function playSlideshowMusic(_, old_view, new_view)
|
|||||||
|
|
||||||
if (new_view.id == "slideshow") then
|
if (new_view.id == "slideshow") then
|
||||||
playCommand = 'rhythmbox-client --play-uri="'..filename..'"'
|
playCommand = 'rhythmbox-client --play-uri="'..filename..'"'
|
||||||
|
|
||||||
--dt.print_error(playCommand)
|
--dt.print_error(playCommand)
|
||||||
dt.control.execute( playCommand)
|
dt.control.execute( playCommand)
|
||||||
else
|
else
|
||||||
if (old_view and old_view.id == "slideshow") then
|
if (old_view and old_view.id == "slideshow") then
|
||||||
stopCommand = "rhythmbox-client --pause"
|
stopCommand = "rhythmbox-client --pause"
|
||||||
--dt.print_error(stopCommand)
|
--dt.print_error(stopCommand)
|
||||||
dt.control.execute( stopCommand)
|
dt.control.execute( stopCommand)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -80,7 +80,7 @@ end
|
|||||||
|
|
||||||
-- Preferences
|
-- Preferences
|
||||||
dt.preferences.register("slideshowMusic", "SlideshowMusic", "file", _("Slideshow background music file"), "", "")
|
dt.preferences.register("slideshowMusic", "SlideshowMusic", "file", _("Slideshow background music file"), "", "")
|
||||||
dt.preferences.register("slideshowMusic",
|
dt.preferences.register("slideshowMusic",
|
||||||
"PlaySlideshowMusic",
|
"PlaySlideshowMusic",
|
||||||
"bool",
|
"bool",
|
||||||
_("Play slideshow background music"),
|
_("Play slideshow background music"),
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ dt.print_error(gettext.gettext("image"))
|
|||||||
|
|
||||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||||
|
|
||||||
gettext.bindtextdomain("gettextExample",dt.configuration.config_dir.."/lua/")
|
gettext.bindtextdomain("gettextExample",dt.configuration.config_dir.."/lua/locale/")
|
||||||
-- Translate a string using the specified textdomain
|
-- Translate a string using the specified textdomain
|
||||||
dt.print_error(gettext.dgettext("gettextExample", 'Hello World!'))
|
dt.print_error(gettext.dgettext("gettextExample", 'Hello World!'))
|
||||||
|
|
||||||
|
|||||||
70
locale/fr_FR/LC_MESSAGES/pdf_slideshow.po
Normal file
70
locale/fr_FR/LC_MESSAGES/pdf_slideshow.po
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: \n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-10 09:30+0200\n"
|
||||||
|
"PO-Revision-Date: 2017-04-10 09:48+0200\n"
|
||||||
|
"Language: fr_FR\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Last-Translator: Pascal Obry <pascal@obry.net>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"X-Generator: Poedit 1.8.11\n"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:55
|
||||||
|
msgid "pdflatex not found"
|
||||||
|
msgstr "pdflatex non trouvé"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:63
|
||||||
|
msgid "a pdf viewer"
|
||||||
|
msgstr "lecteur pdf"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:64
|
||||||
|
msgid "can be an absolute pathname or the tool may be in the PATH"
|
||||||
|
msgstr "peut être un chemin absolu où l'outil peut être dans le chemin par défaut"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:68 pdf_slideshow.lua:95
|
||||||
|
msgid "slideshow title"
|
||||||
|
msgstr "titre du diaporama"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:72
|
||||||
|
msgid "transition delay (s)"
|
||||||
|
msgstr "temporisation (s) entre diapositives"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:83
|
||||||
|
msgid "include image title"
|
||||||
|
msgstr "inclus le titre de l'image"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:85
|
||||||
|
msgid "whether to include the image title (if defined) into the slide"
|
||||||
|
msgstr "indique si le titre de l'image (si défini) doit être inclus dans la diapositive"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:89
|
||||||
|
msgid "include image author"
|
||||||
|
msgstr "inclus l'auteur de l'image"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:91
|
||||||
|
msgid "whether to include the image author (if defined) into the slide"
|
||||||
|
msgstr "indique si l'auteur de l'image (si défini) doit être inclus dans la diapositive"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:167
|
||||||
|
msgid "pdf slideshow"
|
||||||
|
msgstr "diaporama pdf"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:220
|
||||||
|
msgid "problem running pdflatex"
|
||||||
|
msgstr "impossible d'exécuter pdflatex"
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:221 pdf_slideshow.lua:231
|
||||||
|
msgid "problem running "
|
||||||
|
msgstr "impossible d'exécuter "
|
||||||
|
|
||||||
|
#: pdf_slideshow.lua:230
|
||||||
|
msgid "problem running pdf viewer"
|
||||||
|
msgstr "impossible d'exécuter le lecteur pdf"
|
||||||
Reference in New Issue
Block a user