Will digiKam keep my ratings and tags if I rename or move photo files without writing metadata to EXIF?

Asked 4/29/2023

20 views

2 answers

0

I want to store metadata only in digiKam's database, not write it into image files. My concern is that if I rename a photo or move it to another folder, digiKam may no longer recognize it and could treat it as a new file, losing ratings, tags, labels, and similar metadata. How does digiKam identify photos internally, and what should remain unchanged so it can continue matching the same image after files are moved or renamed?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

3y ago

2 Answers

4

Looking at the Digikam database (SQLite version):

  • Photos are identified with unique IDs
  • These ids are linked to a file name and an "album", and a "hash"(*)
  • An "album" has among other things a relative path and a root

So it's not as simple as it looks (even though it makes perfect sense to a programmer like me, this is a rather plain relational database).

Experimentally:

  • I created a "Marker" tag
  • I attached it to an existing picture
  • I exited Digikam
  • I created a directory (under Digikam's "root")
  • I move the picture to it
  • I restart Digikam and:
    1. The new directory and picture are there
    2. The picture still has the tag.

Looking at the database contents, the moved picture still has its original ID, so Digikam detected that it was moved. Given the presence of the hash in the image data, this is not surprising.

More experimentation:

  • Behing Digikam's back, I move the file out of its reach
  • I open Digikam, check that the file isn't there, close Digikam
  • Inspect the database again, the image is still there, but is not associated to an album
  • Move the image back under Digikam's root
  • Open Digikam: the image is there and still has the "Marker" tag
  • Looking at the database contents, it is still the same image id, but it now has an album.

So, all in all, Digikam data seems fairly resilient to file manipulation done outside of it.

Tests done with Digikam 7.5.0.

(*) A hash is a (large) number derived from the file contents (checksum on steroids). Two different files are very unlikely to have the same hash, and if you are given a file, you can compute its hash, and see if you have any other files with the same hash. If not, the file is new, if yes, you only have to compare it with the very few that have the same hash to identify it.

Originally by user75947. Source · Licensed CC BY-SA 4.0

user75947

3y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Based on the community findings, digiKam stores each item with its own internal ID and links it to file-related information such as filename, album/path, and a hash. In testing, a photo that was moved within a digiKam root folder kept the same internal ID and retained its tag after restarting digiKam, which shows digiKam can detect at least some moves.

Practical takeaway: if you want the safest behavior, do renaming and moving inside digiKam itself. That gives the program a direct way to update its database and preserve ratings, tags, and labels.

If you move or rename files outside digiKam, it may still recognize them in some cases, but that is less reliable and harder to track. So the best answer is: don’t rely on external file managers if your metadata lives only in the digiKam database.

If long-term portability matters, writing metadata to files or sidecars is generally safer, but from the provided answers, the most dependable workflow is to use digiKam as your image file manager for moves and renames.

UniqueBot

AI

3y ago

Your Answer