This Python script allows you to adjust the EXIF timestamps of image files, including JPEGs and RAW formats. You can modify the timestamps based on a specified timezone adjustment.
- Python: Ensure Python 3.x is installed on your system.
- ExifTool: This script requires
exiftoolto be installed. You can download it from ExifTool's official website or install it using a package manager.
-
Install Python:
- Download and install Python from python.org.
- Make sure to check the box to add Python to your system PATH during installation.
-
Install ExifTool:
- Windows: Download the Windows executable from here and follow the installation instructions.
- macOS: You can install it via Homebrew:
brew install exiftool
- Linux: Install via your distribution's package manager (e.g.,
apt,dnf):sudo apt install libimage-exiftool-perl
To use the script, navigate to the directory containing timezone-correction.py and run the following command in your terminal:
python timezone-correction.py --dir /path/to/images/ --timezone HH:MM [--negative] [--recursive] [--workers num]Parameters:
--diror-d: Directory containing images.--timezoneor-t: New timezone offset in HH:MM format.--negativeor-n: Specify this flag for negative timezone offsets (e.g., UTC-06:00).--recursiveor-r: Process images in subdirectories recursively.--workersor-w: Number of parallel workers/threads to speed up processing. Default is 1.
Example:
- To adjust the timestamps of images in the directory /path/to/images/ to a new timezone offset of UTC-06:00, you would run:
python timezone-correction.py --dir /path/to/images/ --timezone 06:00 --negative- To specify a positive timezone offset of UTC+02:30, you would run:
python timezone-correction.py --dir /path/to/images/ --timezone 02:30Supported File Formats
This script currently supports the following image file formats:
- JPEG (.jpg, .jpeg)
- TIFF (.tiff)
- HEIC (.heic)
- RAW formats (e.g., .raw, .cr2, .cr3, .nef, .arw, .raf, .rw2, .orf)
- Backup: It is recommended to keep a backup of your images before running the script, especially if you are unsure about the changes.
- EXIF Quality: Modifying the EXIF data does not affect the image quality, as it only updates the metadata.