index
Project · Self-hosted infrastructure

Nextcloud Photo Fixer

A Bash pipeline that heals EXIF and filesystem timestamps across a decade of mixed-source photos and videos, so a self-hosted Nextcloud Photos gallery actually shows them in the right order.

Language
Bash · exiftool · jq
Targets
JPG · MP4 · Google Takeout JSON
License
MIT

Nextcloud Photos orders by EXIF DateTimeOriginal — so if your archive came from phones, cameras, WhatsApp, screenshots, and a Google Takeout, your gallery is a mess. The fix isn't the gallery. The fix is the metadata.

"Great project and nice learning experience! Many other users will find this useful. 🌟" Nextcloud, on LinkedIn

What it does

Usage

# install prerequisites
$ sudo apt install jq libimage-exiftool-perl

# point it at a user's photo tree
$ sudo ./fix_photo_dates.sh \
      "/path/to/nextcloud/data/username/files/Photos"

# then tell Nextcloud to reindex
$ sudo -u www-data php occ files:scan --path=username/files/Photos

Design notes

Why it matters

Most self-hosters solve this by manually curating. The tool automates the same judgement calls — which source to trust, when to leave a file alone — across tens of thousands of files without repeatedly rewriting the ones you already fixed.

→ Tool on GitHub