darktable-org / darktable-org/darktable

darktable starts importing folder before lua scripts loaded

Open
#20,717 10 comments 0 reactions 1 assignee View on GitHub

@wpferguson is already working on this.

Since Apr 3, 2026.

bug: pending lua no-issue-activity reproduce: confirmed scope: DAM
Dominant language
C
Stars
13.1k
Forks
1.4k
Avg merge
22h 14m
Merged PRs (30d)
198

Description

Is there an existing issue for this?
  • I checked and did not find my issue in the already reported ones
Describe the bug

I have enabled a lua script that adds a post-import-image hook. If I add a folder to darktable after it has already started, all images are processed by the script. But if a run darktable /path/to/folder, only some of the images are processed by the script (in one test, 52 out of 96 are processed). I suspect that darktable starts importing the images before the script has finished loading.

Steps to reproduce
  1. I have attached an example script that simply counts the images it has loaded and prints the count and filename of each one. Start darktable and enable the script. Then exit darktable and run darktable -d lua /path/to/folder where the folder has around 100 images and see what the last count shown is.
Expected behavior

Darktable should wait until the lua scripts have all loaded before doing any imports.

Logfile | Screenshot | Screencast

Here is the script. Rename as .lua.
count_imports.txt

Commit

No response

Where did you obtain darktable from?

OBS build

darktable version

5.4.1

What OS are you using?

Linux

What is the version of your OS?

Ubuntu 24.04

Describe your system

32GB, nvidia

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.