Am Mittwoch, 30. August 2017, 12:06:51 CEST schrieb [email protected]:
> On Wed, 30 Aug 2017 20:30:23 +0200
> 
> Tobias Ellinghaus <[email protected]> wrote:
> >Am Mittwoch, 30. August 2017, 10:42:16 CEST schrieb
> >
> >[email protected]:
> >> DT 2.2.5
> >> 
> >> Is there a way of executing some bash after the export (exiftool &
> >> mogrify)?
> >
> >You can use a Lua script for that.
> >
> >Tobias
> 
> Any example? I've never Lua before...

- create the folder ~/.config/darktable/lua/
- in there add a file "run-on-export.lua"
- paste this into the file:

local dt = require "darktable"
dt.register_event("intermediate-export-image",
  function (event, filename, format, storage)
    os.execute("echo 'TODO: do something to " .. filename .. "'")
  end
)

- put the shell commands into os.execute() calls, or call your bash script 
from there
- create ~/.config/darktable/luarc
- put this into the file: require "run-on-export"
- start darktable with "-d lua" to see debug output

That's the simple version. There are more sophisticated ones where you add a 
GUI, create new export storages, ... but this should get you started.

If you want to dive into dt's Lua scripting have a look at
https://www.darktable.org/lua-api/
Please note that the description of the "intermediate-export-image" event that 
we are using here is wrong in the API docs, there is no "image" being passed 
to the callback.

Tobias

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to