While I’ve done some lua for other systems, I’m still pretty new. And this is the first ever attempt with darktable. Git installed, and the script manager shows all the default scripts available.
In the autostyle script (and documentation) it says “set the exif configuration string in your lua configuration”
Using dt 5.0.1 in Windows, where would this be, and how is it done (correct syntax for the entry)?
Can I specify two exif criteria (file extension and make)? (Want to only apply to raw files from that camera, and not jpg’s).
How to specify the Style it should apply, since I have a handful?
Go to preferences (the gear icon at the top left of the main window) and click on it. Select Lua Options
from the left menu.
The documentation is here, darktable lua documentation - autostyle
2 Likes
That’s why I noted referring to the documentation, too.
Here’s all I get in the lua options from the gear:
Figured it out - I have to have the script running for the preferences options to show in the above window.
While I am still having issues with the syntax, it does not seem that I can apply based on more than one EXIF definition, correct?
It does seem to slow down the import process a lot.
yes
Yes, it runs exiftool (a separate external process) against each image as it’s imported.
What EXIF fields are you wanting to use?
File type and Maker.
ie “only apply if it is a DNG and the maker is Apple”
(yeah, I know the issues with using Apple ProRAW and it has to be run through Adobe, but sometimes that is the camera I have…)
autostyle is really overkill for what you want to do (i.e. using exiftool) because the fields you want to filter on are already known to Lua. But, there’s not a script to do simple filtering on known fields and then apply a style. I started one, but got wrapped around the axle trying to figure out a UI and all the rule possibilities (and, or, not) and how to present them in an easy to use manner.
So having said all that here is a simple script that will do what you want. Drop it in your contrib folder and start it with script_manager. Go to preferences → Lua options and specify the name of a style in the style name
field.
applestyle.zip (2.1 KB)
Wow, thank you so much!
And it provides a nice, well structured, example for further exploring lua in darktable.
1 Like
Unfortunately the best (only?) way to learn how to manipulate darktable with Lua is by reading the scripts and then trial and error. I’m planning on writing a programmer’s guide but…
If you have any questions, feel free to ask…