Skip to content

darktable starts importing folder before lua scripts loaded #20717

@jdchristensen

Description

@jdchristensen

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

Metadata

Metadata

Assignees

Labels

bug: pendingsomeone needs to start working on thatluareproduce: confirmeda way to make the bug re-appear 99% of times has been foundscope: DAMmanaging files, collections, archiving, metadata, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions