darktable
darktable copied to clipboard
Bug - Importing from directories with underscores can put images in the wrong film roll (wildcard issue)
Describe the bug
Importing from directories with underscores can put images in the wrong film roll, resulting in images that are inaccessible within Darktable.
The problem appears to be related to underscores being used as a wildcard (i.e. SQL character wildcard), and only occurs if there is a match on the path in the film roll sqlite table.
For example, if images were previously imported from a folder "X:\FOO", subsequently importing images from a folder named "X:\F__" will incorrectly link the images to the "X:\FOO" film roll.
Steps to reproduce
- Create a folder "TEST" and place an image within it.
- Create a folder "T_ST" and place an image within it.
- Import the folder "TEST" into darktable
- Import the folder "T_ST" into darktable
Observe:
- The image in the folder "TEST" is shown correctly
- The image in the folder "T_ST" has metadata loaded, but will not preview or load
- Within the images sqlite database, both images will be linked to the "TEST" film roll
Expected behavior
The image should remain accessible - the wildcard should be escaped
Logfile | Screenshot | Screencast
No response
Commit
No response
Where did you install darktable from?
darktable.org
darktable version
4.4.2
What OS are you using?
Windows
What is the version of your OS?
Windows 11 Pro 22H2 (build 22621.2428)
Describe your system?
No response
Are you using OpenCL GPU in darktable?
Yes
If yes, what is the GPU card and driver?
NVIDIA GeForce RTX 3090, 24 GiB RAM dedicated (90 GiB shared), version 537.58
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response
This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.
Probably as simple as replacing a "LIKE" in an SQL SELECT query with "=", but finding the proper one will take some digging.