Case study
Photo pipeline and gallery
A script that reads each photo's EXIF data, reverse-geocodes the GPS position to a city and country, strips location metadata, resizes for the web, and writes the manifest behind this site's photo gallery.
- Built with
- TypeScript · Sharp · exif-reader · OpenStreetMap Nominatim · Next.js
- Try it
- Browse the photos

The idea
Most of my travel photos carry GPS coordinates in their EXIF data. I wanted a gallery organised by place, without tagging every photo by hand.
How the pipeline works
- Read the metadata. A TypeScript script uses
exif-readerto pull GPS coordinates and the date each photo was taken. - Find the place. Coordinates go to OpenStreetMap's Nominatim API to resolve a city and country. Requests are throttled and cached to respect Nominatim's usage policy.
- Make it web-ready. Sharp resizes each photo for the web (up to 2048 pixels on the long edge) and recompresses it. The published copy keeps no EXIF data, so no GPS coordinates leave my machine.
- Write the manifest. Everything lands in a JSON manifest that the site reads at build time. A CSV export and import round-trip lets me fix captions in a spreadsheet.
The result
The photo gallery currently holds 255 photos from 20 countries, filterable by country, with a full-screen viewer you can drive from the keyboard. Each country also feeds the route page, so photos sit next to the dates I was there.
What I learned
- EXIF is messy. Some photos have no GPS data, and formats vary between phones and apps, so the script flags anything it can't place for manual review.
- Geocoders return admin areas, not places. A beach can come back as a shire or a municipal corporation, so the display names need a clean-up pass.
- Privacy is a feature. Stripping location data from published files is the step that's easiest to forget and matters most.