It is not possible to set image A as an overlay of B, and then set B as an overlay of A, but with 3 images, this is possible:
$ sqlite3 ~/.config/darktable/library.db
SQLite version 3.45.1 2024-01-30 16:01:20
Enter ".help" for usage hints.
sqlite> select * from overlay;
12285|12288
12288|12289
12289|12285
Maybe a recursive query could be used: https://sqlite.org/lang_with.html#recursive_common_table_expressions
Or, a simpler (but more restrictive) solution: don't allow setting an image as an overlay, if it has its own overlay; also, disallow setting an overlay on an image that is already used as an overlay (so if its ID appears in either the imgid or in the overlay_id column).
BTW, shouldn't there be an FK referential integrity constraint be defined for overlay_id (referencing images(id))? And an index on the column?
Steps to reproduce
Use any 3 images:
set the 2nd image as the overlay of the 1st
set the 3rd image as the overlay of the 2nd
set the 1st image as the overlay of the 3rd
Expected behavior
dt should prevent such loops
Logfile | Screenshot | Screencast
No response
Commit
No response
Where did you obtain darktable from?
downloaded from www.darktable.org
darktable version
4.9.0+721~g963cb7e26b
What OS are you using?
Linux
What is the version of your OS?
Ubuntu 24.04
Describe your system?
No response
Are you using OpenCL GPU in darktable?
No
If yes, what is the GPU card and driver?
irrelevant
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
Describe the bug
It is not possible to set image A as an overlay of B, and then set B as an overlay of A, but with 3 images, this is possible:
Maybe a recursive query could be used: https://sqlite.org/lang_with.html#recursive_common_table_expressions Or, a simpler (but more restrictive) solution: don't allow setting an image as an overlay, if it has its own overlay; also, disallow setting an overlay on an image that is already used as an overlay (so if its ID appears in either the
imgid
or in theoverlay_id
column).BTW, shouldn't there be an FK referential integrity constraint be defined for
overlay_id
(referencingimages(id)
)? And an index on the column?Steps to reproduce
Use any 3 images:
Expected behavior
dt should prevent such loops
Logfile | Screenshot | Screencast
No response
Commit
No response
Where did you obtain darktable from?
downloaded from www.darktable.org
darktable version
4.9.0+721~g963cb7e26b
What OS are you using?
Linux
What is the version of your OS?
Ubuntu 24.04
Describe your system?
No response
Are you using OpenCL GPU in darktable?
No
If yes, what is the GPU card and driver?
irrelevant
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response