digiKam does not remember already imported photos

I am not sure if I am doing something wrong here, but here’s my issue:

  • Connect my iPhone to Fedora 40 KDE Spin
  • Chose ‘Download photos with digiKam’ from Devices > Camera
  • In the importer, I select to import only new photos
  • All my pix are getting imported and marked as imported

But after some time when I want to import the most recent pix taken, only a few of the already imported ones are marked as imported, all others look like never imported.

Did I do something wrong to confuse digiKam (e.g. moving or editing pictures)?

@Kwizzz:

How are you connecting the Apple iPhone to the KDE Plasma box?

  • USB cable?
  • Something else?

Personally, I always import photos into digiKam from a “USB Device” – my camera isn’t in the supported camera list (a Sigma sd Quattro … ).


Do you have the necessary digiKam support for HEIF/HEIC installed on your KDE Plasma box?
Here on openSUSE Leap 15.5 it’s the file ‘/usr/lib64/qt5/plugins/digikam/dimg/DImg_HEIF_Plugin.so’ which is supplied by the RPM package “digikam-plugins” – digiKam version 8.3.0.


There’s also this issue with Apple iPhones noted on Reddit – <Importing iphone photos (with digikam?)>

  • Are you certain that, the image file is still physically present on the Pocket Telephone or, has it been auto-magically uploaded to the Apple Cloud?

I am connecting via USB cable. It’s an iPhone and it is properly recognized by the OS. Device trust established, too.
(Accessing the iPhone in general and transferring pictures works w/o any issues.)

Under Disks & Devices I see Camera where I choose “Download photos with digiKam” (instead of the default “Open in File Manager”).

The digiKam Importer starts and displays all photos from iPhone…
…but not all of them as imported, even though I did so.

I just performed the above steps again to better describe what happends, and – lo and behold – a bunch of files imported when I started this thread are again marked as not imported.

None of the files have been touched on the iPhone.
However, I deleted some of the imported files. These are now listed as not imported, yet.
Still, some other files have neither been touched on the laptop, nor on the iPhone, but also listed as not imported.
I also imported such a photo again and confirmed that the md5 hash of such a photo has not changed.

HEIF support is installed; I’m on Fedora 40, so for met it’s under /usr/lib64/qt6/plugins/digikam/dimg/DImg_HEIF_Plugin.so.

$ rpm -q --file /usr/lib64/qt6/plugins/digikam/dimg/DImg_HEIF_Plugin.so
digikam-libs-8.3.0-2.fc40.x86_64
$ dnf info digikam-libs
Last metadata expiration check: 0:01:36 ago on Mon 03 Jun 2024 09:04:04 PM CEST.
Installed Packages
Name         : digikam-libs
Version      : 8.3.0
Release      : 2.fc40
Architecture : x86_64
Size         : 46 M
Source       : digikam-8.3.0-2.fc40.src.rpm
Repository   : @System
From repo    : updates
Summary      : Runtime libraries for digikam
URL          : http://www.digikam.org/
License      : GPL-2.0-or-later
Description  : Runtime libraries for digikam.

That’s why I am wondering: how does digiKam determine if a picture has been imported? What information is stored for this and where?

digiKam stores such information in a database named “digikam4.db” –

  • This database is normally located near the directories where you’re storing your photography files.
  • But, it may be located elsewhere – <Database Settings>

Please note the following information –

Take care to use a place hosted by fast hardware (such as SSD or NVMe) with enough free space especially for thumbnails database. A remote file system such as NFS cannot be used here. For performance and technical reasons relevant of SQLite, you cannot use a media from the network.

Please note that, there are other databases for the thumbnails and face recognition –

 > LANG=C ls -lh /var/local/digiKam/xxx/
total 1.1G
-rw-r--r-- 1 xxx yyy  24M May 29 12:31 digikam4.db
-rw-r--r-- 1 xxx yyy 988K May 29 12:31 recognition.db
-rw-r--r-- 1 xxx yyy  11M May 29 12:31 similarity.db
-rw-r--r-- 1 xxx yyy 1.1G May 29 12:31 thumbnails-digikam.db
 >

You may need to perform some database maintenance – see the digiKam documentation – <Database>

1 Like

Cool!

I guess that DownloadHistory has the imported photos:

sqlite> .schem DownloadHistory 
CREATE TABLE DownloadHistory
                    (id  INTEGER PRIMARY KEY,
                    identifier TEXT,
                    filename TEXT,
                    filesize INTEGER,
                    filedate DATETIME,
                    UNIQUE(identifier, filename, filesize, filedate));

If I search for the photo that I imported, but gut marked as not imported again, I can see:

sqlite> select * from DownloadHistory where filename LIKE '%2109%';
1705|94464604b88539c58d7c8142a4357a6b|IMG_2109.JPG|5394480|2024-06-02T13:02:29.000Z
1833|94464604b88539c58d7c8142a4357a6b|IMG_2109.JPG|5394480|2024-06-02T19:29:50.000Z

This would mean that somehow, magically, the time stamp of the file has been modified (for whatever Apple reason).

Will be digging into this…

Thanks for the pointers!

From a CLI prompt in a Terminal window for the directory where the files are located (or, with Dolphin – “F4” … ) – for the case of JPEG images – « example uses Sigma filenames … »

> jhead -ft _DQ_593*

Or, use “touch” to set the file’s date/time correctly …

  • I haven’t found the appropriate tool for HEIC/HEIF files to adjust the file’s date/time stamp to the time and date when the photo was taken – for JPEG there’s a well-known field in the file’s header …
1 Like