Skip to content

Commit b70fdc0

Browse files
committed
official/apply_camera_style - Fixed decoding errors caused by #18332.
1 parent cd31d18 commit b70fdc0

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

official/apply_camera_style.lua

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ local log = require "lib/dtutils.log"
5252
local MODULE <const> = "apply_camera_style"
5353
local DEFAULT_LOG_LEVEL <const> = log.info
5454
local TMP_DIR <const> = dt.configuration.tmp_dir
55-
local STYLE_PREFIX <const> = "_l10n_darktable camera styles|"
55+
local STYLE_PREFIX <const> = "_l10n_darktable|_l10n_camera styles|"
56+
local MAKER = 3
57+
local STYLE = 4
5658

5759
-- path separator
5860
local PS <const> = dt.configuration.running_os == "windows" and "\\" or "/"
@@ -222,25 +224,25 @@ local function get_camera_styles()
222224
log.msg(log.debug, "got " .. style.name)
223225

224226
local parts = du.split(style.name, "|")
225-
parts[2] = string.lower(parts[2])
226-
log.msg(log.debug, "maker is " .. parts[2])
227+
parts[MAKER] = string.lower(parts[MAKER])
228+
log.msg(log.debug, "maker is " .. parts[MAKER])
227229

228-
if not acs.styles[parts[2]] then
229-
acs.styles[parts[2]] = {}
230-
acs.styles[parts[2]]["styles"] = {}
231-
acs.styles[parts[2]]["patterns"] = {}
230+
if not acs.styles[parts[MAKER]] then
231+
acs.styles[parts[MAKER]] = {}
232+
acs.styles[parts[MAKER]]["styles"] = {}
233+
acs.styles[parts[MAKER]]["patterns"] = {}
232234
end
233-
if parts[3] then
234-
if not string.match(parts[3], "]") then
235-
table.insert(acs.styles[parts[2]].styles, style)
235+
if parts[STYLE] then
236+
if not string.match(parts[STYLE], "]") then
237+
table.insert(acs.styles[parts[MAKER]].styles, style)
236238
local processed_pattern = process_pattern(parts[#parts])
237-
table.insert(acs.styles[parts[2]].patterns, processed_pattern)
239+
table.insert(acs.styles[parts[MAKER]].patterns, processed_pattern)
238240
log.msg(log.debug, "pattern for " .. style.name .. " is " .. processed_pattern)
239241
else
240-
local processed_patterns = process_set(parts[3])
242+
local processed_patterns = process_set(parts[STYLE])
241243
for _, pat in ipairs(processed_patterns) do
242-
table.insert(acs.styles[parts[2]].styles, style)
243-
table.insert(acs.styles[parts[2]].patterns, pat)
244+
table.insert(acs.styles[parts[MAKER]].styles, style)
245+
table.insert(acs.styles[parts[MAKER]].patterns, pat)
244246
log.msg(log.debug, "pattern for " .. style.name .. " is " .. pat)
245247
end
246248
end

0 commit comments

Comments
 (0)