Don't overwrite existing stack slots (that way the first matching image in a stack will be used, vs the last one).
This commit is contained in:
@@ -216,15 +216,21 @@ local function get_stacks(images, encoding_variant)
|
|||||||
if extra_image_extension and df.get_filetype(v.filename) == extra_image_extension then
|
if extra_image_extension and df.get_filetype(v.filename) == extra_image_extension then
|
||||||
is_extra = true
|
is_extra = true
|
||||||
end
|
end
|
||||||
-- we assume every image in the stack is generated from the same source image file
|
-- We assume every image in the stack is generated from the same source image file
|
||||||
local key = df.chop_filetype(v.path .. PS .. v.filename)
|
local key = df.chop_filetype(v.path .. PS .. v.filename)
|
||||||
if stacks[key] == nil then
|
if stacks[key] == nil then
|
||||||
stacks[key] = {}
|
stacks[key] = {}
|
||||||
end
|
end
|
||||||
if extra_image_content_type and (stacks[key]["sdr"] or is_extra) then
|
if extra_image_content_type and (is_extra or stacks[key]["sdr"]) then
|
||||||
stacks[key][extra_image_content_type] = v
|
-- Don't overwrite existing entries
|
||||||
|
if not stacks[key][extra_image_content_type] then
|
||||||
|
stacks[key][extra_image_content_type] = v
|
||||||
|
end
|
||||||
elseif not is_extra then
|
elseif not is_extra then
|
||||||
stacks[key]["sdr"] = v
|
-- Don't overwrite existing entries
|
||||||
|
if not stacks[key]["sdr"] then
|
||||||
|
stacks[key]["sdr"] = v
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- remove invalid stacks
|
-- remove invalid stacks
|
||||||
|
|||||||
Reference in New Issue
Block a user