Skip to content

aames/photoblitz

Repository files navigation

PhotoBlitz

A collection of shell scripts for analyzing and managing EXIF timestamp data in JPEG images, particularly useful for fixing photo organization issues in Apple Photos and other photo management applications.

Prerequisites

  • exiftool must be installed: brew install exiftool
  • Bash shell

Scripts

extract_exif_timestamps.sh

Extracts and analyzes all timestamp-related EXIF data from JPEG files in a directory.

Usage:

./extract_exif_timestamps.sh <directory_path>

Features:

  • Extracts all timestamp fields (DateTimeOriginal, DateTime, DateTimeDigitized, CreateDate, FileModifyDate, GPSDateTime, ContentCreateDate, MediaCreateDate, TrackCreateDate)
  • Creates a CSV file with all timestamp data
  • Analyzes ContentCreateDate formats
  • Performs timezone analysis with offset calculations
  • Compares filename order against timestamp field orders
  • Generates detailed reports for troubleshooting photo sorting issues

Output:

  • Console table showing all timestamp fields
  • CSV file: <directory>/exif_timestamps.csv
  • Detailed analysis sections for timezone and ordering

set_offset_time.sh

Sets the OffsetTimeOriginal EXIF field for a single JPEG file.

Usage:

./set_offset_time.sh <file_path> <offset_time>

Examples:

./set_offset_time.sh /path/to/photo.jpg "+01:00"
./set_offset_time.sh /path/to/photo.jpg "-05:00"

Features:

  • Validates offset format (+HH:MM or -HH:MM)
  • Preserves original file (uses -overwrite_original flag)
  • Verifies the change was applied successfully

set_offset_time_bulk.sh

Sets the OffsetTimeOriginal EXIF field for all JPEG files in a directory.

Usage:

./set_offset_time_bulk.sh <directory_path> <offset_time>

Examples:

./set_offset_time_bulk.sh /path/to/photos "+01:00"
./set_offset_time_bulk.sh /path/to/photos "-05:00"

Features:

  • Processes all JPEG files in the specified directory
  • Shows progress for each file
  • Counts successful and failed operations
  • Non-recursive (only processes files in the specified directory)

check_offset_times.sh

Displays the current OffsetTimeOriginal values for all JPEG files in a directory.

Usage:

./check_offset_times.sh <directory_path>

Features:

  • Lists all JPEG files with their OffsetTimeOriginal values
  • Formatted table output
  • Shows "N/A" for files without offset time data

Common Workflow

  1. Analyze existing timestamps:

    ./extract_exif_timestamps.sh /path/to/photos
  2. Check current offset times:

    ./check_offset_times.sh /path/to/photos
  3. Set timezone offset for all photos:

    ./set_offset_time_bulk.sh /path/to/photos "+01:00"
  4. Verify changes:

    ./check_offset_times.sh /path/to/photos

Use Cases

  • Fix photo chronological ordering in Apple Photos when timezone information is missing
  • Analyze EXIF data to understand why photos are not sorting correctly
  • Bulk update timezone offset information for photos taken in different time zones
  • Debug timestamp inconsistencies between different photo management applications

File Formats

  • Supports JPEG files (.jpg and .jpeg extensions, case-insensitive)
  • Only processes files in the specified directory (not subdirectories)
  • Preserves original files by default

About

A collection of shell scripts for analysing and managing EXIF timestamp data in JPEG images, particularly useful for fixing photo organization issues in Apple Photos and other photo management applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages