While not high on the list of business needs, photo management and sharing is a big part of our social and technical landscape, which has largely been co-opted by the major tech monopolists – especially by Facebook.
Everyone takes photos with their phones these days. We typically don’t even use the camera app on the phone – but rather, a camera integration in a social media app like Instagram or Whatsapp. Integrating camera functionality with a sharing platform is great for reducing user experience friction – but it locks us in to a particular platform. However, unlike social networking which currently depends on using a particular platform, photo sharing doesn’t necessarily require a fully fleshed out social network. If all you want to do is share a photo album of a recent trip with friends and family, and maybe see their comments, all you need is a link and some email addresses.
Set Up Piwigo
Note: This guide assumes you already have easy one-click application installation set up with Yunohost. Optional (but highly recommended) is that you have already set up a Nextcloud server and have installed the Nextcloud file synchronization app on your phone.
Piwigo is another outstanding open source project that has been serving the free/open source software community since 2001. It is a traditional photo gallery application, but it also comes with an awesome plugin ecosystem (like WordPress) and a mobile app. The following guide will show you how to set up Piwigo with photos synchronized from your phone as well as the following functionality:
- tag/category based album creation
- anonymous single-album sharing (no login required)
- picture comments
- full-screen slide-shows
NOTE: Unfortunately, at this time, I cannot recommend the Nextcloud Photos app as it currently depends on a file-system based sharing mechanism which is incompatible with tag/category based sharing.
Install Piwigo with Yunohost
Installing Piwigo with out-of-the-box SSO and user provisioning is easy-peasy, thanks to Yunohost. Simply go to the Yunohost app marketplace and click “Install”.
Loosen Image Filename Restriction
Unfortunately, at the current time, there is still some manual configuration required for Piwigo to accept images with file names containing special characters, such as spaces, parenthesis, apostrophes, etc. This should be fixed, IMO.1
Edit the Piwigo PHP configuration file:
Add the following allowed file name characters:
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_()\'\&. +]+$/';
Enable IPTC Keyword Tags (optional)
IPTC keywords are a fantastic, standards-based way to tag/categorize your photos on the file metadata level. You can add keyword/tags to your photos with desktop photo managers such as Shotwell. (I’m unfamiliar with desktop photo applications for Windows or Mac which do this – if you are, please let me know!)
To configure Piwigo to import IPTC keywords as tags, add the following to your Piwigo PHP configuration file:
$conf['use_iptc'] = true; $conf['use_iptc_mapping'] = array( 'keywords' => '2#025', );
Go to the “Plugins > Manage” section of the Piwigo Admin page and install the following plugins:
- Read Metadata (to support IPTC keywords and other photo/file metadata)
- Share Album (for sharing single-album links that don’t require a login)
- Smart Albums (for creating albums based on IPTC keywords)
- Fotorama (for full-screen slide-shows)
Synchronize Your Image Files
Synchronize Your Nextcloud Server
This guide assumes a setup where all of your image files and your Piwigo photo gallery are on the same file system. If you have set up Nextcloud with additional block storage, your files should be available at
/mnt/files. To connect your photo directories to Piwigo, simply create a “symbolic link”, like so:
ln -s /mnt/files/myphotos /home/yunohost.app/piwigo/myphotos
Next, go to the Piwigo “Tools > Synchronize” page and select the following:
- synchronize files structure with database
- check nothing
- who can see these photos?
- check Admins
- synchronize database photos with files metadata
- check synchronize metadata
- uncheck only perform a simulation
And click “Submit”.
NOTE: You may get a blank page indicating an error if you have a lot of photos to synchronize. Don’t worry! Just refresh your page and eventually the process will complete. Clearly not ideal, so vote for this issue on the Open Source I.T. priorities poll if you find it important.
Synchronize Your Phone
To synchronize your phone, simply download the Nextcloud app, select “Auto upload” from the main menu, and click on the phone folders you want automatically uploaded to your cloud file system. NOTE: Make sure the name(s) of this/these folder(s) is “symlinked” to your Piwigo gallery, as indicated above.
Sharing Albums, Creating Albums from Tags, and Enabling Comments
Now that all of your photos should be synchronized with your Piwigo database, you should be able to browse them by visiting your Piwigo gallery (as an admin) and clicking on the “share” link in the upper-right tool bar.
If your photos have IPTC keyword/tags, you can also create albums to share based on those tags using the “SmartAlbums” plugin.
And if you want your viewers to add comments to photos, simply go to “Configuration > Options > Comments” and check “Activate comments”.
Mobile Access and TV Slide Shows
While Piwigo does have simple and clean Android and iOS apps, these apps do not currently support searching photos by tags or slide-shows. There are also no open source smart TV gallery apps that I know of, at this time.
A common use case for using a mobile device for accessing your photos is to look up a specific photo. For example, the other night I was in bed and remembered a picture of a bird I wanted to view again. At the current time, the way to access such a photo with Piwigo on mobile is a bit clunky. What I do is create a bookmark of the desktop app’s tag page and save it to my phone’s home screen, e.g.
Not ideal, but this will allow you to use your tags to quickly find and share photos, as well as start a full-screen slideshow that you can screen-cast to a smart TV. You can also just create a shortcut to the main gallery page (
/piwigo), which will let you view normal/manually created albums, as well as create dynamic location-based albums (with the OpenStreetMaps plugin) – which is pretty sweet.
Making Tagging and Dynamic Album Creation More Efficient
The photo management and viewing solution discussed in this article allows you to create/view dynamic albums in two ways:
- from tags that you have manually added to your photos, or
- by clicking locations on a map
While Piwigo provides a calendar view, it only allows you to view groups of photos by day, which isn’t very convenient if you want to show a slide-show of pics from a multi-day trip. This seems like it should be a pretty easy feature to implement, so I’m going to add it to my list.
Another way to view your photos is by tagging them automatically with machine learning. Google Photos, for example, does this for you, however I have found Google’s (and other’s) object classification system to still be too broad to completely replace manual tagging – except for maybe facial recognition. Nextcloud has a facial recognition app which I plan on trying out.
Since we may still be several years away from a generally available and sufficiently precise open-source auto-tagging AI, manual tagging is still useful. We can also make improvements to the process of manual tagging. One idea I have is to create a simple mobile app (probably with a technology like React Native, which I’ve been meaning to try out) that accesses recent photos in your phone’s gallery and lets you use voice recognition to conveniently add tags shortly after you’ve taken your photos.
- Cast your vote to prioritize this issue on the Open Source I.T. priorities poll.