Web frontend for the famous open-source software DigiKam Photo Management
Component | Software |
---|---|
OS | Linux or MAC with PHP support |
Database | MySQL or MariaDB |
Image converting | exiftool, exiv2, dcraw, convert (from ImageMagick) |
digiYiiKam uses the Yii2-Framework and was tested with DigiKam running on MySQL as database backend.
flowchart TD
central_location_images(<b>fa:fa-image Central location for all images</b>):::highlight
digikam_thumbnails[(digikam\n<small>Thumbnails</small>\n<i>MySQL</i>)]
digikam_similarity[(digikam\n<small>Similarity</small>\n<i>MySQL</i>)]
digikam_face[(digikam\n<small>Face recognition</small>\n<i>MySQL</i>)]
digikam_main[(digikam\n<i>MySQL</i>)]:::highlight
digiyiikam[(<b>digiyiikam\n<i>MySQL</i></b>)]:::highlight
digikam_main -->|image IDs\nare copied| digiyiikam
digikam_app[fa:fa-camera-retro digiKam Application]
digiyiikam_app[fa:fa-camera-retro fa:fa-globe digiYiiKam Web-App]:::highlight
desktop_client[fa:fa-desktop PC / Mac]
desktop_client --> digikam_app
desktop_client --> digiyiikam_app
central_location_images <--> digiyiikam_app & desktop_client
digikam_app <--> digikam_main
digikam_app <--> digikam_face
digikam_app <--> digikam_similarity
digikam_app <--> digikam_thumbnails
digiyiikam_app <--> digiyiikam
digiyiikam_app <--> |fa:fa-exclamation-triangle Writeback only for tags| digikam_main
classDef highlight stroke:#f00
SQLite should also work, but is not tested. digiYiiKam must have access to the database file from DigiKam.
Be sure, that the Apache or web server user (e.g. www-data on Debian, Ubuntu, ...) has read-access to the image files/folders.
sudo apt update
sudo apt install php mcrypt php-pdo php-intl php-xml php-zip php-mbstring php-mysql php-sqlite3 php-gd unzip composer php-apcu git
On Ubuntu 22.04 (or derivates) exiftool and dcraw should already be fine (and in the right version). You only need to install exiv2 (needed for converting the CR2 file format).
sudo apt-get install exiv2 dcraw imagemagick exiftool
Go to the folder, where digiYiiKam shall be installed. E.g. cd /var/www/
We will now install the Yii2 components and needed extensions with composer.
composer create-project --prefer-dist yiisoft/yii2-app-basic digiyiikam
cd digiyiikam
composer require --prefer-dist daxslab/yii2-thumbnailer "*"
composer require 2amigos/yii2-gallery-widget
composer require kartik-v/yii2-widget-sidenav "*"
composer require yidas/yii2-fontawesome
composer require onmotion/yii2-widget-apexcharts
composer require dmstr/yii2-ajax-button
composer require kartik-v/yii2-widget-spinner "@dev"
cd /tmp
git clone https://github.com/patschwork/digiYiiKam.git
# Copy/move (with overwrite) everything from /tmp/digiYiiKam into /var/www/digiyiikam
# run database migrations
./yii migrate
The config files needs to be renamed for the first time (avoiding overwriting on updates of the application).
Rename the following files:
Sample file | Config file | Decription |
---|---|---|
/config/db_digikam_SAMPLE.php | /config/db_digikam.php | Database connection to the digiKam database |
/config/db_SAMPLE.php | /config/db.php | Database connection to the digiYiiKam database |
/config/params_SAMPLE.php | /config/params.php | Application parameter. Add the collection paths here (where are the images stored) |
/config/web_SAMPLE.php | /config/web.php | Yii2 application config. Should only be edited once for the cookieValidation key. |
Enter your credentials for the DigiKam database: /var/www/digiyiikam/config/db_digikam.php
Create a new (MySQL) database named digiYiiKam aside the digikam database
CREATE DATABASE `digiYiiKam` /*!40100 DEFAULT CHARACTER SET latin1 */
You should consider to create a dedicated MySQL user with restricted rights
CREATE user 'digiyiikam'@'%' identified BY '***RANDOM__PASSWORD__HERE***';
GRANT USAGE ON digikam.* TO 'digiyiikam'@'%';
GRANT SELECT ON digikam.* TO 'digiyiikam'@'%';
GRANT INSERT,DELETE,UPDATE ON digikam.Tags TO 'digiyiikam'@'%';
GRANT INSERT,DELETE,UPDATE ON digikam.ImageTags TO 'digiyiikam'@'%';
GRANT USAGE ON digiYiiKam.* TO 'digiyiikam'@'%';
GRANT SELECT,INSERT,DELETE,UPDATE ON digiYiiKam.* TO 'digiyiikam'@'%';
FLUSH PRIVILEGES;
Enter your credentials for the digiYiiKam database: /var/www/digiyiikam/config/db.php
Set a cookieValidationKey in: /var/www/digiyiikam/config/web.php
Add the collection paths to your local pictures folder. This may be different than from the settings in DigiKam when they are installed on different machines.
/var/www/digiyiikam/config/params.php
Go to the digiyiikam folder and run php yii utils/init-thumbnails-database
Go to the digiyiikam folder and run php yii utils/generate-thumbnails
When you add photos to your collections, digiYiiKam needs to know about this. You can also create regular schedules (e.g. with a cron job) to automate this. Note: Tags and other metadata are always realtime taken from digiKam.
php yii utils/add-thumbnails-database
php yii utils/generate-thumbnails
If you only want to quick test, you can also start the application without set up a Apache or Nginx web server. PHP/Yii2 provides an integrated development server.
Go to the digiyiikam folder and run php yii serve 0.0.0.0 --port=8888
Refreshing the digiYiiKam database was tested successfully using Concourse CI (https://github.com/concourse/concourse). Create an issue if you want to know how it could be working...
https://docs.kde.org/trunk5/en/digikam-doc/digikam/using-setup.html
https://www.yiiframework.com/doc/guide/2.0/en/start-installation
- digiYiiKam needs it's own database to avoid changes to the digiKam database.
- The digiKam database will only be read, with one exception by setting the "heart" tag in digiYiiKam which will make use of the tags also used by digiKam
- digiYiiKam will produce new thumbnails and can't reuse those from digiKam (digiKam thumbnails are incompatible to be shown in the webbrowser). The new thumbnails are stored in the digiYiiKam database
- JPEG images are shown directly from the source collection folder
- RAW images (e.g. CR2, CR3, DNG, NEF) must be converted as JPEG and are stored in the digiYiiKam database
- digiYiiKam has commandline tools for building the thumbnails and converting RAW images to JPEG
- The orignial files will never be modified!
- Browse by file path (albums) or tags
- Show counts of images per tag
- Show JPEG images as thumbnails
- Show CR3 (Canon) images as thumbnails and in gallery
- Show CR2 (Canon) images as thumbnails and in gallery
- Show DNG (Smartphone, Drone) images as thumbnails and in gallery
- Show NEF (Nikon) images as thumbnails and in gallery
- Show more RAW format images (Sony, Fuji, ...) as thumbnails and in gallery
- Show MP4 videos as thumbnails and in gallery
- Tag a favorite image in digiYiiKam using the tag-management from digiKam.
- Show metadata for each image
- Build up thumbnails in database with the command line
- Build up RAW preview-images (as JPEG) in database with the command line
- Show navigation for folder and tags
- Jump to/show all images using the same tag as currently displaying (link to tags)
- Show info pie chart on start page with some statistics
- Set/unset other tags used in digiKam
- Show geo location info
- Browse images upon time frame
- Button to download JPEG preview file
- Button to download RAW source file
- Use Redis cache
- Browse by file path (albums) or tags
- Continue browsing (last path) photos from the last visit
- Build a docker image