Skip to content
Pablo Casas Estévez edited this page May 26, 2021 · 22 revisions

Welcome to the Shotwell-event2folder wiki!

Introduction

Shotwell is a software to manage your personal collection of pictures and videos. You can learn more on its home page.
Shotwell can import pictures from any place on your file-system. It can leave the picture on its place or make a copy on its main library-path. All the data is stored into a SQLite3 Data Base.

One thing I missed from this software is the fact that I could not easily move the files from one place to another on the system, and the fact that I'm used to organize my library in a folder structure (../year/fulldate-event name/date - photoname.jpg ). Once a picture is imported, it remains on its place, even if you change its event or edit the date.

I also use Kodi as my HTPC system and it works by pointing to a folder structure to retrieve photos, so Kodi browses the folders and gets their names. The same happens with other read-only software that points and rely on folder structures and filenames.

As you manage Shotwell, you can change file-titles, dates and, even rename events. These changes won't affect the real filename nor the folder structure they are stored.

I also wanted to have a little repository of the latest pictures on Dropbox, so as I said, it is difficult to select and move the correct portion of pictures without breaking shotwell's pointers or doing manual or extra imports or movements inside its pre-defined library-main-path.

If you use Shotwell to manage your pictures and videos, and you want to move your library or keep a structured library into an event-oriented way, this scrip is for you.

What does this script do?

This script basically reorganize your Shotwell library on a folder oriented structure.
It gets your pictures and create a folder structure using your events. "/Main/path/of/the/library/YEAR/eventdate - eventname/fulldate Picturename.jpg" and so on.

As an extra, you can define a portion of pictures and store them to another place. I use this feature to keep the latest 2Gb of Data in pictures on a separated Dropbox folder.

Included as an option, it can add a starting fulldate identifier on the picture-filename, so if you edit this picture with some external software or get a copy out of the shotwell library, you won't loose the date, because it is in the filename.

Included as an option, you can retrieve the photo's title from the filename. The script discards some useless strings of data stored in the filename. So if you import this file:
"2006-06 The great beer party.jpg", the title of the photo in the database will be "The great beer party" and only imports titles if title at Shotwell database is empty.

You can change the picture's date in Shotwell and reorganize the events, by running this script, the folder event's structure will also get reorganized and the full date identifiers starting at the files will be renamed.

Included as an option, it can select a portion of video-files and process them with ffmpeg utility by compressing them to .mov format. This is useful if you want to convert videos in an standard or unified format. I historically had .3gp .avi .mkv .mp4 videos but now i have only .mov videos with an optimized format and Bitrate, and even more with its date inserted as metadata.

Included as an option, it can auto-date the "no date" event images. It retrieves the date from the filename or path where they are stored. It also can force to fetch the timestamp from the file system as the image's date. It informs this retrieved date as metadata if you have this option activated at Shotwell's preferences.

Notes about the system

This is a python3 script written for linux. I've been using this script since ubuntu 14.04, and till now (see readme)

How to run this script

Just save the code and run it from the command line.

python3 Shotwell_event2folder.py

The software will create the folders that are needed on the target folder library. It also generates a log file on the same place from where it is run.

The configuration file.

The first time the software is run, it creates a configuration file at your user directory called ~/.Shotwell-event2folder/Shotevent2folder_cfg.py

open and configure it by your needs. <Link to the configuration file>

A note about other script that I use: If you have old scanned photographs but without EXIF data, you can use Photodeliver to guess/extract a date identifier from the filename or its path and store it as EXIF metadata before importing the collection in Shotwell or another date-based software. I also use it as hot-folder for processing an images' inbox. Have fun! https://github.com/pablo33/PHotodeliver