Skip to content

v2025.6: Advanced Timezone Support & Photo Metadata Improvements

Choose a tag to compare

@leonspok leonspok released this 28 Jun 22:37
· 16 commits to main since this release
03a5c50

🕐 Major Timezone Enhancements

This release introduces comprehensive timezone support for photo geotagging, ensuring accurate handling of photos taken in different timezones.

✨ New Features

Timezone-Aware Photo Processing

  • EXIF Timezone Reading: Automatically reads timezone offset fields (OffsetTimeOriginal, OffsetTimeDigitized) from photo metadata
  • Timezone Preservation: Original photo timezones are preserved when applying time adjustments and writing back to photos
  • Smart Timezone Priority: CLI timezone overrides take precedence over original photo timezones, which take precedence over system timezone
  • Unified Date/Timezone Computation: Date and timezone are now computed together on-demand for better performance and consistency

Enhanced CLI Timezone Support

  • Comprehensive Format Support: Accepts GMT offsets (+05:00, -08:00, Z), timezone abbreviations (EST, PST, CET), and timezone identifiers (America/New_York)
  • Validation & Error Handling: Robust parsing with proper error messages for invalid timezone formats
  • Time Offset Integration: Works seamlessly with existing time offset functionality

🛠️ Architecture Improvements

Protocol Enhancements

  • Throwable Date Property: GeotaggingItemProtocol.date now throws to properly handle EXIF reading errors
  • Flexible Implementation: Non-throwing implementations (like PHAssetGeotaggingItem) remain simple while file-based items can handle errors

Performance Optimizations

  • Lazy EXIF Reading: Photo metadata is only read when date/timezone is actually needed
  • Early Exit Optimizations: Skip unnecessary file operations when no valid date is available
  • Reduced File I/O: Only writes timezone EXIF tags when explicit timezone information exists

🧪 Testing & Quality

Comprehensive Test Coverage

  • Timezone Scenarios: Tests for various timezone combinations, DST transitions, and edge cases
  • End-to-End Testing: Complete workflow validation from EXIF reading to timezone-aware writing
  • CLI Integration Tests: Validation of timezone parsing and formatting functionality
  • 40 Total Tests: All passing with robust coverage of core functionality

📋 Technical Details

Key Components Modified

  • ImageIOReader: Enhanced to read timezone offset fields and create timezone-aware dates
  • ImageIOWriter: Updated to write timezone information with proper priority handling
  • ImageIOGeotaggingItem: Unified date/timezone computation with early validation
  • GeotaggingItemProtocol: Made date property throwable for better error handling

Compatibility

  • Backward Compatible: All existing functionality preserved
  • PHAsset Support: Simplified non-throwing implementation for Photos framework integration
  • CLI Enhancement: Extended timezone support without breaking existing workflows

🔧 Bug Fixes

  • Fixed timezone context loss when writing back adjusted photos
  • Resolved timezone calculation errors in date parsing
  • Corrected UTC calendar usage to prevent system timezone interference
  • Fixed early exit logic to avoid unnecessary file operations

This release significantly improves the accuracy and reliability of photo geotagging across different timezones, making it ideal for travelers and photographers working with images from multiple time zones.