Google Photos EXIF Editor

Google Photos EXIF Editor

Overview

Google Photos EXIF Editor is a Python application designed to fix metadata (especially date information) for photos and videos downloaded from Google Photos. The program solves the problem of lost original capture dates during Google Photos export by restoring these dates to the EXIF data and file system.

Technical Architecture

The application consists of three main modules:

  1. Core Engine (core): File processing logic
  2. Graphical Interface (gui): User interface
  3. Main Module (main.py): Entry point

How It Works

1. Date Extraction Strategy

The program uses three sources to extract date information:

  • JSON Meta Files: Extracts capture dates from .supplemental-meta.json files created during Google Photos export.
  • Filename Analysis: Detects date information from various known filename formats:
    • 2023.05.15 12.34.56.jpg
    • 20230515_123456.jpg
    • 2023-05-15-12-34-56.jpg
    • IMG_20230515_ or VID_20230515_
    • Other formats

2. EXIF and File Date Update

Once the date is found:

  • JPEG Files: EXIF data is updated using the piexif library. Three EXIF date fields are set:

    • DateTimeOriginal
    • DateTimeDigitized
    • DateTime
  • All File Types: File system creation and modification dates are updated.

3. Supported File Formats

The program supports:

  • Photos: .jpg, .jpeg, .png, .heic, .webp
  • Videos: .mp4, .mov

Core Engine (exif_processor.py)

This module provides the main functionality:

  • Date extraction algorithms
  • EXIF data manipulation
  • File system date management
  • Batch file processing

Key functions:

  1. get_timestamp_from_json(): Extracts date from JSON
  2. get_timestamp_from_filename(): Extracts date from filename
  3. update_exif_date(): Updates EXIF data for JPEGs
  4. update_file_system_date(): Updates file system dates
  5. process_file(): Processes a single file
  6. scan_and_process(): Processes all suitable files in a folder

Graphical Interface (app.py)

Provides a modern UI for easy user interaction:

  • Folder selection
  • Progress indicators
  • Detailed logs
  • Stop function

The interface is built with PyQt5 and features a stylish “Nordic” theme.

Multithreading Support

The ProcessingWorker class uses Qt’s QThread for asynchronous processing, so:

  • The UI never freezes
  • Large folders are processed in the background
  • Progress is updated in real time

Nordic Theme (nordic_theme.py)

Provides a visually appealing interface based on the “Nord” color palette:

  • Dark blue/gray background
  • Bright text colors
  • Blue and green highlights
  • Rounded corners

Error Handling

The app is robust:

  • Comprehensive try-catch system for startup errors
  • Tracks number of successful/failed files
  • Detailed error reporting

Packaging and Distribution

The app can be packaged as a single executable with PyInstaller, so users don’t need to install Python. PyInstaller command:

python -m pyinstaller --noconfirm --onefile --windowed --add-data "src/assets;src/assets" src/main.py

Conclusion

Google Photos EXIF Editor is a modern, easy-to-use tool for restoring and fixing date information in photos and videos downloaded from Google Photos. With its PyQt5 interface, multithreading support, and robust error handling, it is both functional and user-friendly.

Key strengths:

  • Multi-format support
  • Smart date extraction
  • Modern, responsive UI
  • Multithreaded performance
  • Detailed progress and logs

This tool is especially valuable for photo enthusiasts who download large Google Photos archives and want to preserve original capture dates.