Tenki: Diary for your photos


Photos usually tell a story on their own. But it never hurts to add some context to them, though. Why did you take the photo? What was the weather that day? Did anything noteworthy happen on that day? Having contextual information in the photo itself transforms it from a mere artefact into a visual diary. It's possible to embed text content into the EXIF metadata, so you can have a JPEG file with a description attached to it. The tricky part is actually to write the content you want into the photo itself. It's practically impossible to do this directly in the camera, so you have to wait till you transfer your photos to a machine, and then add text to each photo manually. Not only is it a laborious process, it's also impractical. If you haven't written down the info you want to add somewhere else, you are unlikely to remember what the weather was like on that specific day and what thoughts crossed your mind.

Enter Tenki, a simple notepad for your photos. Here is how it works. When you are out taking photos, open the Tenki page in a browser on your smartphone. Hit the Get Coordinates button to obtain your current location and jot down notes in the Note field. When you press the Save button, Tenki automatically fetches the weather conditions for the current location and saves this information together with the notes. If you don't need weather info, enter text and hit Save without pressing the Get Coordinates button. For each date, Tenki creates a YYYY-MM-DD.txt file (for example, 1970-01-31.txt) in the data folder. If the file already exists, Tenki appends the weather info and note to it. To download all data files as a ZIP archive to your local machine, use the Download button. To keep things secure and simple, Tenki doesn't allow you to edit and delete entries directly. You can view the last seven entries below the form.

To run Tenki, you need a web server with PHP. The server must have an SSL certificate installed. In practical terms, this means that the server must support HTTPS. This is required for the browser geolocation feature to work. The good news is that most hosting providers, even the cheapest ones, offer PHP and SSL support out of the box.

Deploying Tenki on your server is a straightforward procedure. First, grab the latest version of the application from the project's website and unpack the downloaded archive. Open the config.php file for editing and specify the required settings. If you want Tenki to obtain weather info, get a Weatherbit API key, and use it to replace the example value in the config.php file. By default, Tenki shows only the last seven entries, but you can change that by modifying the value of the $linum variable. Once you've configured the settings, save the changes, and upload the entire tenki folder to your web server. That's all there is to it.

After you have transferred the photos to your machine and downloaded files from Tenki's data directory, you can use practically any application that supports editing EXIF metadata to add information from data files to the photos. In the unlikely case that your preferred photo management application doesn't support editing EXIF metadata, there are plenty of dedicated EXIF editors for all mainstream platforms.

If you happen to use Linux or macOS X, you can use the supplied write-to-exif.sh script to automate the process of adding information from Tenki to multiple JPEG files. First, open the file, then edit the copyright information and specify the path to the folder for storing Tenki data files. Save the changes and run the following commands to install the script:

sudo cp write-to-exif.sh /usr/local/bin/write-to-exif
sudo chown root:root /usr/local/bin/write-to-exif
sudo chmod 755 /usr/local/bin/write-to-exif

Download data files from Tenki's data directory to the local folder specified in the write-to-exif.sh script. In the terminal, switch to the folder containing JPEG files and run the script using the write-to-exif command.

This is an excerpt from the Linux Photography book. Get your copy from Gumroad


© Dmitri Popov