contrib/AutoGrouper - create group leader for first image in table.
Add grouped images to the group leader and not
the previous image.
This commit is contained in:
@@ -132,10 +132,11 @@ local function main(on_collection)
|
|||||||
for i, image in ipairs(images) do
|
for i, image in ipairs(images) do
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
prev_image = image
|
prev_image = image
|
||||||
|
image:make_group_leader()
|
||||||
elseif string.match(image.exif_datetime_taken, '[%d]') ~= nil then --make sure current image has a timestamp, if so check if it is within the user specified gap value and add to group
|
elseif string.match(image.exif_datetime_taken, '[%d]') ~= nil then --make sure current image has a timestamp, if so check if it is within the user specified gap value and add to group
|
||||||
local curr_image = image
|
local curr_image = image
|
||||||
if GetTimeDiff(curr_image, prev_image) <= GUI.gap.value then
|
if GetTimeDiff(curr_image, prev_image) <= GUI.gap.value then
|
||||||
images[i]:group_with(images[i-1])
|
images[i]:group_with(images[i-1].group_leader)
|
||||||
end
|
end
|
||||||
prev_image = curr_image
|
prev_image = curr_image
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user