ExifTimestamp is a Python tool designed to update the EXIF timestamp of JPEG images. By ensuring accurate timestamps in the EXIF metadata, this tool helps you correctly organize and store your images in services like Amazon Photos.
- Automatically reads the folder structure to derive image dates.
- Updates EXIF timestamps based on the folder’s year and month-day structure.
- Supports recursive processing of nested folders.
- Simple and lightweight, leveraging
piexiffor EXIF operations.
Amazon Photos and similar services often rely on EXIF timestamps to organize images by date. If the EXIF metadata is missing or incorrect, your photos may be displayed out of order. ExifTimestamp ensures that your photos are organized properly by aligning their timestamps with your folder structure.
- Python
- Pip installed on your system
- Clone the repository:
git clone https://github.com/sya-ri/ExifTimestamp cd ExifTimestamp - Install the required Python library:
pip install -r requirements.txt
-
Prepare your image folders with the following structure:
<base_directory> ├─2023 │ ├─1005 │ └─1006 ├─2024 │ ├─0217 │ └─0930Here,
2023/1005represents October 5, 2023. -
Run the script:
python main.py
-
Enter the base directory when prompted:
Enter the base directory path: /path/to/your/base_directory
The script will automatically process all JPEG files within the folders and update their EXIF timestamps.
Enter the base directory path: C:\Users\User\Pictures
Starting to update EXIF timestamps in C:\Users\User\Pictures
Processing folder: C:\Users\User\Pictures\2023\1005, Base date: 2023-10-05 00:00:00
Updated C:\Users\User\Pictures\2023\1005\IMG_001.JPG -> 2023:10:05 00:00:00
Updated C:\Users\User\Pictures\2023\1005\IMG_002.JPG -> 2023:10:05 00:00:01
All EXIF timestamps updated successfully!
- Only works with JPEG files (
.jpg,.jpeg). - Assumes the folder names follow the
YYYY/MMDDpattern. - Overwrites existing EXIF timestamps; ensure you have backups.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to open issues or submit pull requests to enhance the functionality.
- This project uses the
piexiflibrary for EXIF metadata manipulation.