darktable icon indicating copy to clipboard operation
darktable copied to clipboard

Misleading message when deleting duplicate

Open dtrtuser opened this issue 1 year ago • 3 comments

Describe the bug

More of an enhancement request than a bug per se...

When deleting a duplicate, the pop-up window warns us if we want to "physically delete selected image (using trash if possible)". This is kind of misleading as in fact (and thankfully) no image is deleted but only a particular processed version of the image is deleted.

I would suggest a warning message saying: "Delete duplicate? do you really want to delete the selected duplicate (without deleting the original image on disk)?"

Screenshot from 2024-03-28 00-32-28

Steps to reproduce

Open an image in darkroom Delete a duplicate in "duplicate manager"

Expected behavior

I would suggest a warning message saying: "Delete Duplicate? do you really want to delete the selected duplicate (without deleting the original image on disk)?"

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

self compiled

darktable version

4.7

What OS are you using?

Linux

What is the version of your OS?

Ubuntu 23.10

Describe your system?

No response

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

dtrtuser avatar Mar 28 '24 07:03 dtrtuser

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.

github-actions[bot] avatar May 28 '24 00:05 github-actions[bot]

reminder for 4.8.1 image

MStraeten avatar Aug 14 '24 21:08 MStraeten

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.

github-actions[bot] avatar Oct 14 '24 00:10 github-actions[bot]

This issue was closed because it has been inactive for 300 days since being marked as stale. Please check if the newest release or nightly build has it fixed. Please, create a new issue if the issue is not fixed.

github-actions[bot] avatar Aug 10 '25 00:08 github-actions[bot]

This is not a difficult issue, but it somehow went unnoticed and no one took it up. I'll reopen the issue and take care of it.

victoryforce avatar Aug 14 '25 12:08 victoryforce

Actually the message is correct. The image in darktable is destroyed and can't be retrieved. The problem OP has is the definition of image. OP defines image as the source file (raw or non-raw)..

darktable defines an image as a source file (raw or non-raw), database entries, and an xmp file (if not disabled).

  • the first image in a sequence is source file + database entries + xmp file
  • the second and following duplicates consist of a source file + database entries + xmp file
  • if you delete the fourth duplicate, the xmp file and the database entries are removed
  • if you delete darktable's idea of the original image, the xmp file and the database entries are removed. The source file is not, because the 2nd and 3rd duplicate still remain.
  • The source file isn't deleted until all references to it are deleted.

Let's say you import 20 files and make 10 duplicates of each, so now you have 220 images. Let's also say the xmp files are turned off. So, if you look in the folder where the 20 files were, there are still only 20 files. If you delete original of each image and the first 9 duplicates, you have 20 images left. If you look in the folder, you still have 20 files.

So the bottom line is image doesn't equal source file.

wpferguson avatar Aug 14 '25 15:08 wpferguson

  • The source file isn't deleted until all references to it are deleted.

Everything you wrote is correct, but as a user I am interested in what exactly the action I am currently performing deletes. There is a huge difference between deleting only additional records about alternative image processing history (duplicates), in which the source image file is not deleted, and deleting the source file itself. The latter is a much more dangerous action.

The message when deleting duplicates is not specific enough and talks about images, not duplicates. I can't say that it is very bad, but it is a little scary for an inexperienced user who is just learning the program and can imagine that the dialog box warns about deleting the source file. This is not as bad as, on the contrary, insufficient warning, but why scare the user when we can simply provide as accurate information as possible.

victoryforce avatar Aug 14 '25 15:08 victoryforce

when we can simply provide as accurate information as possible.

But you can't since if you delete the original and there is a duplicate, then the original file is not deleted, but the original image is.

EDIT: delete is destructive, so that's why you have to confirm. The image in lighttable disappears and can't be recovered. How that is implemented as far as the file system is concerned is an implementation detail and shouldn't be exposed to the user.

wpferguson avatar Aug 14 '25 15:08 wpferguson

but as a user I am interested in what exactly the action I am currently performing deletes

Then the workflow should be go in the filesystem and delete the file, then start darktable and delete the missing images to make darktable match the file system.

wpferguson avatar Aug 14 '25 16:08 wpferguson

when we can simply provide as accurate information as possible.

But you can't since if you delete the original and there is a duplicate, then the original file is not deleted, but the original image is.

Yes, that's exactly why I can.

Again, everything you wrote is correct. Deleting the "zero version" in the duplicate module (if there is another version, i.e. duplicate, the only version in this module cannot be deleted) is no different from deleting any other duplicate. Or, in your words: the original file is not deleted, but the original image is.

So, no matter which version of the image we delete, even if it is the "original" version, the source image file is not deleted. That's why we can ask in the confirmation dialog whether the user confirms the deletion of the duplicate (without deleting the source image file on disk).

victoryforce avatar Aug 14 '25 16:08 victoryforce

Here's my issue. The button is named delete, not delete duplicate. If you select an image with no duplicates and delete it, then the source file as well as the other items attached to that file are deleted.

So I have a lighttable full of images, some that are duplicates and some that are just originals. I select a mix of those and click the delete button. What message are you going to show me? Are you going to show me a list of the files that are going to be deleted? Do I get to pick and choose in case I made a mistake?

It's not just a simple message change, it's a workflow change.

wpferguson avatar Aug 14 '25 16:08 wpferguson

I just went back up and looked and saw where @MStraeten added a picture, so now I understand the point. I was thinking lighttable and the delete button in actions on selected images.

So, you can disregard my above comments, unless you decide to change the button in actions on selected images :grin:

wpferguson avatar Aug 14 '25 17:08 wpferguson