Skip to content

Latest commit

 

History

History
124 lines (89 loc) · 3.91 KB

File metadata and controls

124 lines (89 loc) · 3.91 KB

gtakeout

A command-line utility for processing Google Takeout photo and video metadata and updating EXIF timestamps.

Overview

When you export your photos and videos from Google Photos using Google Takeout, you receive .supplemental-metadata.json files alongside your media files. These JSON files contain metadata including the original photo/video taken time. This tool automatically updates the EXIF/metadata of images and videos that lack timestamps using the information from these metadata files.

Features

  • Recursively searches directories for Google Takeout metadata files
  • Supports both images and videos (JPG, PNG, MP4, MOV, AVI, MKV, M4V, 3GP, WebM, FLV, WMV)
  • Parallel processing across all CPU cores for maximum performance
  • Extracts photo/video timestamps from JSON metadata
  • Checks existing EXIF/metadata to avoid overwriting
  • Updates EXIF DateTimeOriginal, DateTime, and CreateDate fields
  • For videos, also updates MediaCreateDate, TrackCreateDate, and related QuickTime tags
  • Provides summary statistics after processing

Prerequisites

  • Rust toolchain (for building)
  • exiftool must be installed on your system

Installing exiftool

Linux (Debian/Ubuntu):

sudo apt install libimage-exiftool-perl

Linux (Fedora/RHEL):

sudo dnf install perl-Image-ExifTool

macOS:

brew install exiftool

Other systems: Download from exiftool.org

Installation

cargo build --release

The binary will be available at target/release/gtakeout

Usage

gtakeout <DIRECTORY>

Where <DIRECTORY> is the path to your Google Takeout export folder.

Example

# Process all photos in the Takeout directory
gtakeout ~/Downloads/Takeout

# Process a specific album
gtakeout ~/Downloads/Takeout/Google\ Photos/My\ Album

Output

The tool will:

  • Display which files are being updated
  • Skip files that already have EXIF dates
  • Report any errors encountered
  • Show a summary of operations performed

Example output:

Searching for supplemental metadata files in: test
Updated: test/IMG-20161219-WA0000.jpg
Skipped (already has EXIF date): test/IMG-20200101-WA0001.jpg

Summary:
  Metadata files found: 2
  Images updated: 1
  Errors: 0

How It Works

  1. Scans directory recursively for *.supplemental-metadata.json files
  2. Collects all matching files into a list
  3. Processes all files in parallel using all available CPU cores
  4. For each metadata file, determines the corresponding image/video filename
  5. Detects file type (image or video) and checks for existing date metadata:
    • For images: Uses fast native EXIF reader
    • For videos: Uses exiftool to check QuickTime/MP4 date tags
  6. If no date exists, extracts photoTakenTime.timestamp from JSON
  7. Converts Unix timestamp to EXIF datetime format (YYYY:MM:DD HH:MM:SS)
  8. Uses exiftool to write the timestamp with appropriate tags:
    • For images: DateTimeOriginal, DateTime, CreateDate
    • For videos: Also sets MediaCreateDate, MediaModifyDate, TrackCreateDate, TrackModifyDate

Performance

The application uses Rayon for parallel processing, which automatically distributes the workload across all available CPU cores. This provides significant performance improvements when processing large Google Takeout exports:

  • On a quad-core system, expect up to 3-4x speedup compared to sequential processing
  • On an 8-core system, expect up to 6-8x speedup
  • Actual speedup depends on I/O performance and the speed of exiftool operations

Safety

  • Original files are modified directly (exiftool uses -overwrite_original flag)
  • Only images without existing EXIF dates are modified
  • Make a backup of your photos before running if you're concerned

License

This project is licensed under the WTFPL (Do What The Fuck You Want To Public License) - see the LICENSE file for details.

In short: You just DO WHAT THE FUCK YOU WANT TO.