Skip to content

fpatron/media-metadata-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Media Metadata Fix

A desktop application for restoring metadata to photos exported from Google Photos. When you download your library via Google Takeout, the original EXIF data (GPS coordinates, timestamps) is stripped from the images and stored separately in sidecar JSON files. This tool reads those JSON files and writes the metadata back into the image files.

Features

  • Restores GPS coordinates (latitude, longitude, altitude) to image EXIF data
  • Restores capture timestamps (DateTime, DateTimeOriginal, DateTimeDigitized)
  • Supports JPEG and PNG formats
  • Preserves existing EXIF fields, only GPS and datetime tags are updated
  • Processes entire directory trees recursively
  • Non-destructive, outputs to a separate directory, leaving originals untouched
  • Real-time progress tracking with a per-file status log

How It Works

Google Takeout exports each photo alongside a .json file with the same base name. The JSON contains the original capture time and GPS location. This tool:

  1. Scans the input directory recursively for .json sidecar files
  2. Reads the title, geoData, and photoTakenTime fields from each JSON
  3. Locates the corresponding image file
  4. Writes the metadata into the image's EXIF data
  5. Saves the updated image to the output directory, preserving the original folder structure

Requirements

  • Rust (stable toolchain)

Installation

git clone https://github.com/FrancisPatron/media-metadata-fix.git
cd media-metadata-fix
cargo build --release

The compiled binary will be available at target/release/media-metadata-fix.

Usage

Run the application:

cargo run --release
  1. Click Browse... next to Input Directory and select the folder containing your Google Takeout export (the folder with your images and their .json sidecars).
  2. Click Browse... next to Output Directory and select where you want the updated files saved.
  3. Click Process Media.

Progress is shown in real time. Each file is marked as succeeded or failed in the status log. When complete, a summary shows the total number of files processed and any errors encountered.

Supported File Formats

Format Extension
JPEG .jpg, .jpeg
PNG .png

JSON Sidecar Format

The tool expects the standard Google Takeout JSON format:

{
  "title": "IMG_1234.jpg",
  "photoTakenTime": {
    "timestamp": "1609459200"
  },
  "geoData": {
    "latitude": 40.7128,
    "longitude": -74.0060,
    "altitude": 10.5
  }
}

Dependencies

Crate Purpose
eframe GUI framework
rfd Native file/folder picker dialog
kamadak-exif Reading and writing EXIF data
png Decoding and encoding PNG files
serde_json Parsing JSON sidecar files
chrono Timestamp parsing and formatting

Development

Run the test suite:

cargo test

Check formatting:

cargo fmt -- --check

CI runs on every push to main and on all pull requests (build, test, and format check).

License

See LICENSE.

About

A desktop application for restoring metadata to photos exported from Google Photos. When you download your library via Google Takeout, the original EXIF data (GPS coordinates, timestamps) is stripped from the images and stored separately in sidecar JSON files. This tool reads those JSON files and writes the metadata back into the image files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages