1
0
Fork
You've already forked gtakeout
0
No description
Find a file
Armin Walland 96d7263abe Rename all image references to media for consistency
- Rename get_base_image_path() to get_base_media_path()
- Rename test_get_base_image_path() to test_get_base_media_path()
- Update all variable names from *_image to *_media in tests
- Update summary output from "Images updated" to "Media files updated"
- Update all comments and assertions to use "media file" instead of "image"
This improves code clarity since the tool handles both images and videos.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025年10月28日 00:16:37 +01:00
.idea initial commit 2025年10月27日 23:48:47 +01:00
src Rename all image references to media for consistency 2025年10月28日 00:16:37 +01:00
test initial commit 2025年10月27日 23:48:47 +01:00
.gitignore initial commit 2025年10月27日 23:48:47 +01:00
Cargo.lock initial commit 2025年10月27日 23:48:47 +01:00
Cargo.toml Implement complete Google Takeout EXIF updater with parallel processing 2025年10月27日 23:53:51 +01:00
CLAUDE.md Add comprehensive video file support 2025年10月28日 00:05:36 +01:00
LICENSE Implement complete Google Takeout EXIF updater with parallel processing 2025年10月27日 23:53:51 +01:00
README.md Update README.md 2025年10月28日 00:08:19 +01:00

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.