20 May 2025

DigiKam Projects

Topics: Audio and Video
Tags: Digikam
DigiKam is a great tool for managing personal photo libraries, but it lacks any concept of projects. A little bit of hacking makes the user's DigiKam profile switchable.

DigiKam is a great FOSS tool available on Windows, Mac and of course, Linux. A severe limitation is that it has no concept of Projects or Profiles, and it’s album/collection management isn’t intuitive.

What DigiKam does is manage libraries of digital images. It reads and edits tags, and writes metadata to the files and xmp sidecars. For example I have a large archive of family photos, with DigiKam I’ve scanned for face tags, which both automates the tagging but identifies individuals within a photo, as well as tagged images manually (face tagging doesn’t always work). DigiKam keeps bot—h a database of my images and updates the metadata in my files with my added information. I recommend using both embedded and sidecar, because the sidecars can be read as text files and not every image viewing utility will show all the metadata. Of course it presents galleries of your images and allows you to search on metadata.

The way DigiKam both embeds and generates sidecars makes your collections very portable. When I was last evaluating alternatives, I was surprised at the uneven support of these features, and that some platforms could read, but not write extended data.

Albums and Collections are related features that impact each other, but the dialogs are in completely separate places and don’t link to each other. Collections can be on any local, remote, or removable file system that is mounted. When you add a Collection it automatically creates an Album. However, from the Albums Dialog you cannot add a Collection. Within an Album, child albums are just folders and moving items between albums does move (or copy) the files.

Many of us have multiple collections of photos, for example we might have work related and personal collections. It follows that when we open our Photo Manager we would want the option of working on only one project.

When you first run DigiKam it asks where your Pictures are and to set up a database, the default is SQLite, and I recommend using a local SSD for performance. One thing to keep in mind is that once you’ve configured it to write metadata into the files and sidecars, the database is redundant — it can be rebuilt be re-scanning your files (which can take a while). To add photos from other locations you can either import them (which makes a copy), or go to settings and find the collections dialog to add an alternate collection. Unfortunately, there is no built in mechanism for keeping different profiles or project sets.

My workaround is to create multiple profiles and a script to switch between them.

Creating Switchable Profiles

The DigiKam Config File and Your First Profile

On Linux the configuration file is likely to be ~/.config/digikamrc. I created a ~/.config/digikam folder to hold my profiles. If you want to keep your existing profile, give it a name, and the extension .digikamrc, and move it into the new digikam folder. When you run the script it will show a list with the name you gave your profile. After you select it ~/.config/digikamrc will be a symlink to that file.

Additional Profiles

To create a new profile, you’ll need to unlink ~/.config/digikamrc. Then launch DigiKam, it will prompt you to select a location for pictures. I recommend picking a place in your file system that has fast storage and free space to create all of your profile data directories under. When you launch DigiKam you will go through the setup again. You can choose the location where your project images are located as the image location. On the database tab create a subfolder matching the name you’re going to give this profile, your SQLite files will go there. After completing the wizard check the settings to make sure that you are both writing data to files and creating sidecar files. Exit DigiKam.

Just as for the first profile move ~/.config/digikamrc to ~/.config/digikam/<profileName>.digikamrc. When you run the script your new profile will be available.

DigiKam Switch script

Copy this script into your path and make it executable. Adjust any of the paths as appropriate. Also available as a snippet on BitBucket

#!/bin/bash

# https://techinfo.brainbuz.org/posts/digikam-projects/

# Define the config directory
CONFIG_DIR=~/.config/digikam

# Get a list of available config files
CONFIG_FILES=($(ls "$CONFIG_DIR"/*.digikamrc))

read -r -d '' HELP <<"EOF"

DigiKam Profile Switcher

Link ~/.config/digikamrc to a file in ~/.config/digikam/ to switch DigiKam profiles betwen projects.

To create a new profile, manually unlink ~/.config/digikamrc, launch DigiKam to create a new profile,
then move the digikamrc into the digikam folder with the extension digikamrc.

EOF

# Check if there are any config files
if [ ${#CONFIG_FILES[@]} -eq 0 ]; then
  echo "No config files found in $CONFIG_DIR"
  exit 1
fi

# Print the available config files
echo "Available config files:"
for i in "${!CONFIG_FILES[@]}"; do
  echo "$((i+1)). ${CONFIG_FILES[i]##*/}"
done

CUR=`readlink -f ~/.config/digikamrc`
echo "----"
echo "current config is: ${CUR}"
echo "----"

# Ask the user to choose a config file
read -p "Enter the number of the config file you want to use: " CHOICE

# Validate the user's choice
if [ $CHOICE -lt 1 ] || [ $CHOICE -gt ${#CONFIG_FILES[@]} ]; then
  echo "Invalid choice"
  echo "$HELP"
  exit 1
fi

# Kill running digiKam processes
pkill --signal 3 digikam
# Create a symlink to the chosen config file
ln -sf "${CONFIG_FILES[CHOICE-1]}" ~/.config/digikamrc

echo "Config file switched to ${CONFIG_FILES[CHOICE-1]##*/}"