Exporting files in darktable

Hi, just a question about exporting in darktable.
I like to keep my exported images on a different drive and folder to my raw images.
I keep raw images in
In RawTherapee or ART I can set up the export to always export images to the correct folder by using:
There are backslashes between the pictures, d2, d1 and f, they don’t seem to display here.
so that the exported file mirrors the last 2 folder levels of the raw file.
It is really convenient because my files are always exported to the right place without having to keep change the export location manually.
Is there a way of doing this in darktable?
Thanks in advance…

To my knowledge darktable’s export module isn’t aware where the edited image(s) reside. This means that it doesn’t have an equivalent for %dx or %px that is available in RawTherapee.

darktable does have a wide variety of predefined options (the ${discriptor} variables, hover over the target storage field to see them.

It is also able to use bash string manipulation for if there is no predefined one you want/need. This is more powerful then what RawTherapee offers, but might not be all that easy to get your head around or as user friendly… Here’s a webpage that deals with bash string manipulation.

**EDIT: **

Also have a look here: darktable docs - Variables

My above answer stands but I had a little time to have a more indept look at your specific issue and might have come up with an answer.

First of all: I’m a Linux user and do not know that much about Windows. That being said. Assumptions for this example:

  • Locations of the RAW files: /some/fixed/part/2021.01.31/whatever the last 2 folders are variable and the first three are fixed.
  • Destination prefix: /user/anton
  • Input file example: /some/fixed/part/2021.01.31/whatever/photo01.nef
  • Output file example: /user/anton/2021.01.31/whatever/photo01 (extension is provided depending on setting in module)

The following:


Results in:


I have tested this on Linux, with forward slashes and that works nicely. I’m not sure if this works on Windows though.

1 Like

Thanks so much for all your help, I will give it a try and see if it works…

FWIW I use two things to manage my exports. One is the use of symbolic links to simplify and unify my paths. I have DT on 3 computers and the local folders are not on the same drive/path locations so I have named them all DT_Photos. Then I have a second root folder for edits DT_PhotoEdits.

Using this string as an export preset I mirror the folder structure in each. So in the end one has the originals and xmp files and one has only my jpg exports which is nice for viewing esp on other devices.


I am sure there are lots of ways to achieve what you need given the flexible syntax you can use…