this is a loose set of scripts that i use to generate a static website to present a slideshow of outdoorsy trip photos and GPS tracks.
it’s based on a basic gallery app called lightgallery, which supports photos, gifs, and videos (and also iframes i guess).
a map inset is provided by leaflet, which shows the location of the current photo, GPS tracks, waypoints, and other map annotations.
the outstanding missing feature is a separate inset for an elevation profile, with an indicator for the current photo.
to create a simple photo gallery, from a directory of DSLR photos, using template-simple-dslr.html
- get photos in order. exif tag CreateDate is used, ensure this is accurate on all photos
- run
make_gallery_assets.sh
(modify path first) - this creates thumbnails - run
main.py
(modify path first) - this creates the HTML page in one step, assuming no captions are needed
mkdir -p my-trip/{img,img-thumb,video,video-poster,video-thumb,gps}
- get photos in order
- copy photos into
my-trip/img
- ensure all photo timestamps and/or timestamp filenames are correct.
- try
scripts/exiftouch.sh
, but be sure to check that the exif tag its using exists, and contains good data. - if using photos from multiple devices, check exif key/value for each device, each app, and each media type (e.g. still photo, motion photo, panorama, HDR, … and videos and gifs)
- lots of notes on how fucked up this is in
scripts/generate-metadata.py
.
- try
- ensure all photo geotags are present (TODO don’t require this)
- use
convert
to generate thumbnailsfor f in *.jpg ; do convert $f -resize 5% ../thumb/$f ; done
- copy photos into
- get videos in order
- copy videos into
my-trip/video
- ensure all video timestamps and/or timestamp filenames are correct
- ensure all video geotags are present (TODO don’t require this)
- use
ffmpeg
to generate “posters”- by frame:
ffmpeg -i VID_20200902_193614.mp4 -vframes 1 VID_20200902_193614.jpeg
- by timestamp:
ffmpeg -i VID_20200902_193614.mp4 -ss 00:09 VID_20200902_193614.jpeg
- by frame:
- use
convert
to generate thumbnails from the posters
- copy videos into
- copy tracks to
my-trip/gps/*.gpx
or maybe*.json
- run
scripts/generate-metadata.py
- update/add new device-specific sections to the
get_details
function (TODO: switch behavior based on hardware name in exif tag - possibly unreliable) - (TODO: use tracks to interpolate position & elevation for each photo)
- update/add new device-specific sections to the
- add comments to the metadata file (TODO pull from exif and/or load from a separate
comments.csv
file or something) - run
scripts/generate-html.py
. this is a separate script because metadata often requires some manual cleaning. - move resulting file to
my-trip/index.html
also:
- add any new icons
- add waypoints file and annotations file
- TODO: move to GeoJSON and load from server? might not make sense, not sure if all the data these need to contain make sense to put into GeoJSON
- copy track GeoJSON contents to
my-trip/gps/tracks.js
- TODO: load the GeoJSON files directly from the server
see the sample-trip
directory for an example directory structure showing where to put images, videos, and map data.
convert gpx to geojson
ogr2ogr -f GeoJSON pecos1.json Pecos_Wilderness_Backpacking_Day_1.gpx tracks
convert svg icon to png with transparent background
convert -background none noun_summit_2674795.svg summit.png
research notes
pretty straightforward except for a couple minor TODOs
UI is great, but just seems like it wasn’t made for this
https://stackoverflow.com/questions/20119488/how-to-embed-a-leaflet-map-into-a-reveal-js-presentation https://github.com/ralexrdz/reveals-leaflet/
pretty straightforward
https://blog.mastermaps.com/2012/08/showing-gps-tracks-with-leaflet.html
https://github.com/lvoogdt/Leaflet.awesome-markers
https://developers.google.com/maps/documentation/embed/get-started
didn’t try because leaflet worked fine