Hi guys,
I took my holiday snaps with exposure bracketing and JPEG+RAW, so I ended
up with six versions of the same image. I wrote a little Lua script to
autogroup these images.
Images that were taken in the same second (more specifically, the
exif_datetime string) are put in the same group. I would have hoped to have
a better basis for the decision, but there doesn't seem to be anything
there.
That said, apart from making the lighttable view a less cluttered, there
doesn't seem to be much you can do with groups -- I would have hoped you
could batch-rank or delete whole groups, but I don't think you can. Oh
well; less clutter is a start.
I figured it might be useful for someone out there. No guarantee that this
won't mangle your library, of course, but it worked fine for me (on
Darktable unstable). :) Thanks to Jeremy Rosen for pointing me into the
right direction in IRC.
Installation: As with other scripts, add the code to a new file
autogroup.lua in the ~/.config/darktable/lua folder and add require
"autogroup" to your luarc.
Usage: Assign a shortcut for the autogroup function in the settings, select
images to be autogrouped, hit the shortcut.
Cheers
Moritz
PS: Devs, a function to reload all Lua scripts without restarting Darktable
would make script development much faster.
dt = require "darktable"
local function callback()
pics_by_second = {}
for key,pic in ipairs(dt.gui.selection()) do
if pics_by_second[pic.exif_datetime_taken] == nil then
pics_by_second[pic.exif_datetime_taken] = {}
end
curgroup = pics_by_second[pic.exif_datetime_taken]
curgroup[pic.id] = pic
end
created_count = 0
for _,group in pairs(pics_by_second) do
firstpic = nil
for _,pic in pairs(group) do
if firstpic == nil then
firstpic = pic
else
pic.group_with(pic, firstpic)
end
end
end
end
dt.register_event("shortcut", callback, "autogroup images taken in the same
second")
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Darktable-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/darktable-users