Bug 503009 - DigiKam fails to detect imported photos on `add image`
Summary: DigiKam fails to detect imported photos on `add image`
Status: RESOLVED DUPLICATE of bug 319001
Alias: None
Product: digikam
Classification: Applications
Component: Import-Albums (other bugs)
Version First Reported In: 8.6.0
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-19 11:45 UTC by kde_org@reepie.nl
Modified: 2025-04-19 12:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kde_org@reepie.nl 2025-04-19 11:45:45 UTC
SUMMARY
Digikam doesn't indicate already uploaded images as being present. A record is present in the `DownloadHistory` table.
When it uploads an already existing image, it doesn't show the `has already been uploaded` mark on the import dialog screen when done. No duplicate image seems to be present in the album nor on disk. BUT the `DownloadHistory` table now lists TWO records for this image with DIFFERENT hashes.

This behaviour is inconsistent between uploads. A previous upload maybe handled without problems. The next has this problem. So it is difficult to reproduce clearly. These steps are based on trying to see why images were indicated as not being downloaded.

STEPS TO REPRODUCE/happened
1. Add images option with a local directory with new images to add to the album. Type *.HEIC (iPhone) 
2. 'Download all' -> images are processed. With `Date-based sub albums`
3. Album and images are present when done -
4. Re-visit `Add images` with the same directory
5. All images are shown as not being downloaded before
6. Focus on one image -> DownloadHistory entry exist for it
7. Select the image to download again and download it -> icon indicator doesn't change: still `not downloaded before`
8a. DownloadHistory contains TWO records for the same image name and details with DIFFERENT hashes
8b. NO duplicate image has been downloaded as there is no duplicate file in the album (on disk) or in the album overview
9. Re-visit `Add images` with the same directory AGAIN
10. NOW the specific image IS indicated as being uploaded before

I am aware that DK is not able to de-duplicate already existing images which are not downloaded with the tool. In this case images are downloaded from the same folder from a different machine: e.g. it is the identical source.

It is unclear to me how the hash can be used to track relation in other tables. 

OBSERVED RESULT
Already downloaded image not being detected
Duplicate entries in Downloadhistory tabel after 2nd download with DIFFERENT hashes (same name, size, date)

EXPECTED RESULT
Images being indicated as downloaded when present in (any) album
No duplicate entries in Downloadhistory table for the same image

SOFTWARE/OS VERSIONS
macOS: 15.5.1 with Digikam 8.6.0

ADDITIONAL INFORMATION
MariaDB: 11.7.2-MariaDB Homebrew 
Images located on a Linux Ubuntu 24.04 server
Comment 1 Maik Qualmann 2025-04-19 12:19:59 UTC

*** This bug has been marked as a duplicate of bug 319001 ***
Comment 2 kde_org@reepie.nl 2025-04-19 12:31:58 UTC
I am not sure I completely concur as it being the same as 319001?
My point here is that an image being imported and being recorded in DownloadHistory is still not being seen as downloaded. From all issue in the space I have understood that images which _are_ downloaded by the tool should be seen as downloaded. And in many cases that seems to work. In some it doesn't which is what this issue tries to convey.
I am all for a better mechanism which detects duplicates on upload, which is what 319001 seems to suggest?