diff --git a/contrib/image_time.lua b/contrib/image_time.lua index 28570c1a..c0971306 100644 --- a/contrib/image_time.lua +++ b/contrib/image_time.lua @@ -154,12 +154,12 @@ local function systime2exiftime(systime) end local function vars2exiftime(year, month, day, hour, min, sec) - local y = tonumber(year) and string.format("%4d", year) or " " - local mo = tonumber(month) and string.format("%02d", month) or " " - local d = tonumber(day) and string.format("%02d", day) or " " - local h = tonumber(hour) and string.format("%02d", hour) or " " - local m = tonumber(min) and string.format("%02d", min) or " " - local s = tonumber(sec) and string.format("%02d", sec) or " " + local y = tonumber(year) and string.format("%4d", year) or "0000" + local mo = tonumber(month) and string.format("%02d", month) or "00" + local d = tonumber(day) and string.format("%02d", day) or "00" + local h = tonumber(hour) and string.format("%02d", hour) or "00" + local m = tonumber(min) and string.format("%02d", min) or "00" + local s = tonumber(sec) and string.format("%02d", sec) or "00" return(y .. ":" .. mo .. ":" .. d .. " " .. h .. ":" .. m .. ":" .. s) end diff --git a/lib/dtutils/string.lua b/lib/dtutils/string.lua index 7648f6f6..48221f19 100644 --- a/lib/dtutils/string.lua +++ b/lib/dtutils/string.lua @@ -994,7 +994,7 @@ local function treat(var_string) log.msg(log.info, "ret_val is " .. ret_val) elseif string.match(var_string, "SEQUENCE%[") then - local start, width = string.match(var_string, "(%d+),(%d)") + local width, start = string.match(var_string, "(%d+),(%d)") local seq_val = tonumber(substitutes[var]) local pat = "%0" .. width .. "d" substitutes[var_string] = string.format(pat, start + (seq_val - 1)) diff --git a/locale/de_DE/LC_MESSAGES/clear_GPS.po b/locale/de_DE/LC_MESSAGES/clear_GPS.po index ad8960b0..420ec484 100644 --- a/locale/de_DE/LC_MESSAGES/clear_GPS.po +++ b/locale/de_DE/LC_MESSAGES/clear_GPS.po @@ -14,7 +14,7 @@ msgstr "" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.4\n" "Language: de_DE\n" diff --git a/official/apply_camera_style.lua b/official/apply_camera_style.lua index b748ef95..fe836c3b 100644 --- a/official/apply_camera_style.lua +++ b/official/apply_camera_style.lua @@ -52,7 +52,9 @@ local log = require "lib/dtutils.log" local MODULE = "apply_camera_style" local DEFAULT_LOG_LEVEL = log.info local TMP_DIR = dt.configuration.tmp_dir -local STYLE_PREFIX = "_l10n_darktable camera styles|" +local STYLE_PREFIX = "_l10n_darktable|_l10n_camera styles|" +local MAKER = 3 +local STYLE = 4 -- path separator local PS = dt.configuration.running_os == "windows" and "\\" or "/" @@ -165,6 +167,8 @@ local function process_pattern(pattern) pattern = string.gsub(pattern, " ", " ?") -- escape dashes pattern = string.gsub(pattern, "%-", "%%-") + -- make spaces optional + pattern = string.gsub(pattern, " ", " ?") -- until we end up with a set, I'll defer set processing, i.e. [...] -- anchor the pattern to ensure we don't short match pattern = "^" .. pattern .. "$" @@ -223,25 +227,25 @@ local function get_camera_styles() log.msg(log.debug, "got " .. style.name) local parts = du.split(style.name, "|") - parts[2] = string.lower(parts[2]) - log.msg(log.debug, "maker is " .. parts[2]) + parts[MAKER] = string.lower(parts[MAKER]) + log.msg(log.debug, "maker is " .. parts[MAKER]) - if not acs.styles[parts[2]] then - acs.styles[parts[2]] = {} - acs.styles[parts[2]]["styles"] = {} - acs.styles[parts[2]]["patterns"] = {} + if not acs.styles[parts[MAKER]] then + acs.styles[parts[MAKER]] = {} + acs.styles[parts[MAKER]]["styles"] = {} + acs.styles[parts[MAKER]]["patterns"] = {} end - if parts[3] then - if not string.match(parts[3], "]") then - table.insert(acs.styles[parts[2]].styles, style) + if parts[STYLE] then + if not string.match(parts[STYLE], "]") then + table.insert(acs.styles[parts[MAKER]].styles, style) local processed_pattern = process_pattern(parts[#parts]) - table.insert(acs.styles[parts[2]].patterns, processed_pattern) + table.insert(acs.styles[parts[MAKER]].patterns, processed_pattern) log.msg(log.debug, "pattern for " .. style.name .. " is " .. processed_pattern) else - local processed_patterns = process_set(parts[3]) + local processed_patterns = process_set(parts[STYLE]) for _, pat in ipairs(processed_patterns) do - table.insert(acs.styles[parts[2]].styles, style) - table.insert(acs.styles[parts[2]].patterns, pat) + table.insert(acs.styles[parts[MAKER]].styles, style) + table.insert(acs.styles[parts[MAKER]].patterns, pat) log.msg(log.debug, "pattern for " .. style.name .. " is " .. pat) end end