Tomas Sobek Photography

Free high resolution images

Photogallery Photogallery
Panoramas Panoramas
Slideshows Slideshows
Articles Articles

Extracting camera input profiles from Darktable database

13 November 2016

Motivation

In order to keep my Darktable's input colour profile list under control, I wanted to know which particular profile files are in use. Looking in either XMP sidecar files or in the SQLite database ($HOME/.config/darktable/library.db) shows this information encoded and not easily readable.

Solution

As suggested by Tobias Ellinghaus, one of the Darktable developers, the data is stored as BLOB and can be decoded by casting the BLOB data onto a structure used in Darktable code. So this is exactly what my simple code does.

Usage

First download my program and unzip it somewhere. Install prerequisite packages (this is for Mint 18):

$ sudo apt-get install sqlite3 libsqlite3-dev

With SQLite packages in place you should be now able to compile my code:

$ cd {location of unzipped files}
$ gcc -o input_profiles input_profiles.c -lsqlite3

If everything went smoothly, you should have now input_profiles executable ready. Copy your Darktable SQLite database in the same location as the program and run it to produce a CSV file:

$ cp $HOME/.config/darktable/library.db .
$ ./input_profiles >profiles.csv

Then open the CSV file in LibreOffice Calc etc. You should see a list of image filenames, their profile types, and profile filenames in case of ICC profiles from your ~/.config/darktable/color/in/ directory.

Please let me know if you notice any issue or inaccuracy in this article.