This is a simple script that creates a slideshow from a list of images and a GPX file. This is developed mostly to work with the GPX files generated by FindPenguins, but it should work with any GPX file that contains a single track segment and a list of waypoints. The code is a bit messy because I tried to outsource as much as possible to ChatGPT which didn't work out as well as I hoped.
Feel free to try it out for your own travels and let me know if you have any issues or suggestions for improvements. Also feel free to hack on the code and contribute your changes back to the project. This was optimized for my south-west USA road trip so it might not be well tuned for you. If you travel by bike for example you will want to adjust the threshold for when an animation is created (currently 25km).
- Create an odp ("PowerPoint") slideshow from a list of images and a GPX file
- Detect segments of longer drives and flights between waypoints (obviously this is not perfect, only works with sensible waypoints)
- Create animations of the detected drives/flights from the GPX data using Google Maps (requires an API key, adding OpenStreetMap support shouldn't be too hard)
- Add a minimap to the lower right corner of the images showing the current location
- Add a timestamp above the minimap showing the current time
- Guess the location of pictures without GPS data based on the timestamps and the GPX data
- Use embedded GPS data if available
You need to have Python 3 installed. You can create a venv and install the required packages by running
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Add your gpx file as travel-route.gpx
in the data folder.
Create a folder with the images you want to include in the slideshow. In that folder you have to create a folder per timezone (replacing slashes with underscores), e.g. Europe_Berlin
or America_Los_Angeles
. Sadly EXIF metadata doesn't necessarily contain the timezone information, so you have to sort the images manually. If your images contain GPS data the GPS timestamp will be used so you only need to create one folder and put them in there.
The output time above the minimap will be in the timezone of the (temporally) closest trackpoint.
Pictures currently need to be in the JPEG format.
The two things you have to set are your Google Maps API key and your photo directory. To get a Google Maps API key you have to create an account with Google Cloud and enable the Maps API. You can find a guide on how to do that here. The amount of free requests should be more than enough to create a few slideshows a year.
Create a .env file for that in the root directory and add the following lines:
GOOGLE_MAPS_API_KEY=<your api key>
PHOTO_DIR=<your photo directory>
You can adjust the settings in the settings.py
file. There you could also change the input file path, the minimap size or different settings regarding caching if you enable it (useful for debugging to avoid having to call the Google Maps API all the time).
Run the main script using python create-slideshow.py
. This will show you the progress of the different steps and create a file called output.odp
in the root folder.
Once this is done you might want to adjust the ordering of the slides and put the route/flight animations in a slightly differnet position. You can simply use LibreOffice Impress or PowerPoint to do that. Currently the cutoff for the animations to decide whether an image is put before or after the animation is the middle of the time between the beginning point of the animation and the end point. That might not be ideal for some cases. Also you will currently need to add videos manually as they are not supported by the script at the moment.