Skip to content

Latest commit

 

History

History
76 lines (62 loc) · 2.58 KB

File metadata and controls

76 lines (62 loc) · 2.58 KB

ExifTimestamp

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.

Features

  • 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 piexif for EXIF operations.

Why Use ExifTimestamp?

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.

Prerequisites

  • Python
  • Pip installed on your system

Installation

  1. Clone the repository:
    git clone https://github.com/sya-ri/ExifTimestamp
    cd ExifTimestamp
  2. Install the required Python library:
    pip install -r requirements.txt

Usage

  1. Prepare your image folders with the following structure:

    <base_directory>
    ├─2023
    │   ├─1005
    │   └─1006
    ├─2024
    │   ├─0217
    │   └─0930
    

    Here, 2023/1005 represents October 5, 2023.

  2. Run the script:

    python main.py
  3. 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.

Example Output

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!

Limitations

  • Only works with JPEG files (.jpg, .jpeg).
  • Assumes the folder names follow the YYYY/MMDD pattern.
  • Overwrites existing EXIF timestamps; ensure you have backups.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to enhance the functionality.

Acknowledgments

  • This project uses the piexif library for EXIF metadata manipulation.