Export and share photos with digiKam

Exporting Photos to Remote Hosts

The KioExportImport plugin allows digiKam to access files, websites, and remote hosts using KDE's KIO library (Figure 4). In practical terms, this plugin can be used to export photos directly from digiKam to remote machines via supported protocols (FISH, FTP, SFTP, SMB, and many others). This functionality can come in handy not only for off-site backup but also for publishing photos with web applications that are not directly supported by digiKam.

Figure 4: The "Export to remote computer" option can be used to upload photos to remote machines via a variety of supported protocols.

For example, if you happen to use Mejiro [2], cobbled together by yours truly, you can use the KioExportImport plugin to upload photos to the application. To do this, select the photos you want to upload and choose Export | Export to remote computer (Figure 4). Enter the URL to the remote destination directory, which should look something like the following (replace 127.0.0.1 with the actual domain name or IP address of the machine running Mejiro):

fish://127.0.0.1/var/www/mejiro/photos

To transfer the selected photos now, hit the Start export button.

digikamWebUi

As a desktop application, digiKam doesn't provide functionality for accessing the entire photo library via the web. The digikamWebUi [3] software fills this void by adding a web interface that allows you to view and manage photos in digiKam albums using nothing but a browser.

Although digikamWebUi is easy to use, deploying the application requires some manual work. The following installation instructions assume that you're deploying digikamWebUi on the same machine running digiKam, where all photos and digiKam databases are stored in the /home/user/photos directory. The machine itself runs Debian or Ubuntu (or any of their derivatives).

digikamWebUi runs on the Apache/PHP/SQLite stack, so the first step is to install the required components:

sudo install apache2 php5 php5-sqlite sqlite3 git

The next step is to install and configure the CakePHP framework that powers digikamWebUi. Switch to the /var/www directory and download the current release of CakePHP using the following commands, replacing x.x.x.tar.gz with the actual version number of the latest CakePHP release. You can check the latest version number at https://github.com/cakephp/cakephp/releases:

cd /var/www
sudo wget https://github.com/cakephp/cakephp/archive/x.x.x.tar.gz

Unpack the downloaded archive and rename the resulting directory cakephp:

sudo tar xzvf x.x.x.tar.gz
sudo mv x.x.x cakephp

Make cakephp writable by the server using the sudo chown -R www-data cakephp/ command, open the /var/www/cakephp/app/Config/core.php file for editing, and change the default value of the Security.salt parameter to a string consisting of 63 random alphanumeric characters (you can use the https://www.grc.com/passwords.htm page to generate a random string). Next, set the Security.cipherSeed parameter to a different 29-number random value.

Now open the default file with sudo nano /etc/apache2/sites-enabled/000-default for editing and locate the following fragment:

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

Change the AllowOverride None command to AllowOverride All and save the file; then, enable the mod_rewrite Apache module:

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

Now you are ready to install digikamWebUi. Make sure that you are still in the /var/www directory and clone the project's repository:

sudo git clone https://github.com/mehdilauters/digikamWebUi.git digikamwebui

Open the database file for editing with sudo nano digikamwebui/app/Config/database.php and add the database connection profiles shown in Listing 1.

Listing 1

Database Connection Profiles

 

Next, switch to the /home/user/photos directory and create the digikamWebUi.db SQLite database using the supplied digikamWebUi.sql file:

cd ~/photos
sqlite3 digikamWebUi.db < /var/www/digikamwebui/app/Config/Schema/digikamWebUi.sql

It's important that the created database has the same permissions as the /photos directory, so use the chmod 777 -R ~/photos command to apply the same permissions to the directory and all the files in it.

Finally, open the /var/www/digikamwebui/app/Config/core.php file for editing and change Configure::write('debug', 2); to Configure::write('debug', 0); to disable debugging messages.

Point the browser to http://127.0.0.1/digikamwebui/users/add and add a new user. Once you've done that, go to http://127.0.0.1/digikamwebui/users/login, log in using the specified credentials, and you should see digikamWebUi in all its beauty (Figure 5).

Figure 5: digikamWebUi adds a web interface to digiKam.

digikamWebUi's interface is divided into three columns. The Albums column to the left shows a hierarchical list of all albums in digiKam, and you can switch to a specific album by clicking on its name. When processing the digiKam library, digikamWebUi parses tags found in photos and lists them in the Tags column to the right. As you would expect, clicking on a tag shows all photos containing the tag. The middle column shows thumbnails of photos in the currently selected album or photos containing a specific tag. To view a larger version of a photo, click on its thumbnail.

Commands under each photo can be used to perform common operations, such as deleting, rotating, and rating the photo. Choosing Edit opens the photo editing page. Here, you can edit the photo's name, assign tags, and move the photo to a different album. Using digikamWebUi, you can display photos as a slideshow and view them on the map (Figure 6). The latter feature can be used not only to show photo thumbnails on the map but also to travel in time using the timeline slider at the top.

Figure 6: digikamWebUi makes it possible to view photos on a map.

When using digikamWebUi, keep in mind that it needs to cache files when it accesses digiKam albums for the first time. That means it can be pretty slow in the beginning. digikamWebUi is still rough around the edges, but if you need to access and manage your digiKam albums via the web, this is the tool you need.

Final Word

Although digiKam is first and foremost a desktop application, it features export capabilities that can be used to push photos to a variety of popular photo-sharing and file storage services. Additionally, if you need to access your digiKam library via the web, digikamWebUi has you covered.

The Author

Dmitri Popov has been writing exclusively about Linux and open source software for many years, and his articles have appeared in Danish, British, US, German, Spanish, and Russian magazines and websites. Dmitri is an amateur photographer, and he writes about open source photography tools on his Scribbles and Snaps blog at http://scribblesandsnaps.wordpress.com.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News