A script that fixes the metadata from a google photos export and converts it to jpegxl
Rust 93%
Shell 4%
Nix 3%
Just <1%

readme.md

gfoto-metadata-fixer #

This repo contains two parts:

  • a google takeout exif restorer in gfoto-fixer/
  • A jpegxl and AV1 compression tool.

These are run independently of one another, there is more info about each one down below. This script NEVER moves, overwrites or deletes your images! So if you want to try it out, its totally safe to do so!

The google takeout exif restorer #

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

This CLI tool 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"

It doesnt handle images that were edited in google photos, however those can be manually fixed and are simply copied into the failed directory.

The compression tool #

This repo also includes a jxl and av1 converter project. It takes all the images and convertes them to jxl/av1, and is able to spread it out over seperate computers!

There is a server component (converter-server/) that distrebutes the files, and a client component (converter-client/) 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_failed, depending if the conversion succeeded or not 😛.

Video files ARE NOT processed by default, if you want to enable them, then simply set INCLUDE_VIDEOS=true in the env before starting the server (the server will confirm this choice when starting up). Note: if you already started it before without setting it, or want to simply do the videos late, then remove the video files in converter_failed/ (don't worry, the files here are simply copies!).