A script that fixes the metadata from a google photos export and converts it to jpegxl
Rust 92.2%
Shell 4.1%
Nix 3.1%
Just 0.6%
1 1 0

Clone this repository

https://tangled.org/mrsnowy.dev/gfoto-metadata-fixer https://tangled.org/did:plc:5fbqdlfpahlht7gu4c6zrdpj/gfoto-metadata-fixer
git@knot.tangled.mrsnowy.dev:mrsnowy.dev/gfoto-metadata-fixer git@knot.tangled.mrsnowy.dev:did:plc:5fbqdlfpahlht7gu4c6zrdpj/gfoto-metadata-fixer

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
readme.md

gfoto-metadata-fixer#

The script#

I havent been able to find a script that handles the image restoration correctly, so i decided to write my own. This cli app is very fast, however it still depends on how fast your drive is!

This script does the following:

  • Restores original file names
  • Fixes incorrect file extensions (needed for fixing exif data)
  • Restores EXIF OriginallyCreated data
  • It copies the files and the into a new directory (with the same structure) instead of overwriting the existing files.
  • If it cant find the metadata for a file it will put it in a seperate directory

It handles some bullshit that google does that I have encountered myself:

  • Google trims the metadata json to 46 chars
  • Duplicate files that google decides to give a weird metadata file.
    • "IMG_20180214_171835513(1).jpg" has the metadata file "IMG_20180214_171835513.jpg.supplemental-metada(1).json"

The converter#

This repo also includes a jxl and av1 conversion project. It takes all the images and convertes them to jxl/av1 spread out over seperate computers.

There is a server component that distrebutes the files, and a client component that converts it to jxl/av1, restores the exif, and sents it back to the server. The server than stores it in two folders, converted or converted_fucked, depending if the conversion succeeded or not :P.