Skip to content

NadavK/easyexif

Repository files navigation

EasyExif

EasyExif is a Python library to easily edit EXIF dates in image and video files, and also file-system times (created/modified time).

Installation

  1. Make sure you have Python
  2. Download EasyExif
  3. Download Phil Harvey's amazing ExifTool: https://exiftool.org/
  4. Install prerequisites:
pip install PyExifTool piexif pywin32

Usage

python easyexif.py {to} {from} {filename}

{to} defines which attributes to update (can be multiple):

  • c: OS Created-date
  • m: OS modified-date
  • n: Filename-prefix. Adds a prefix to the filename in this format: YYYYMMDD-HHMMSS~)
  • x: EXIF

{from} defines where to take the value to be set:

  • c: OS Created-date
  • m: OS Modified-date
  • n: Filename-prefix. Expects the filename to contain a date prefix in this format: YYYYMMDD-HHMMSS~)
  • x: EXIF
  • YYYY-MM-DD[THH[:MM[:SS]]] explicit date
  • +HH:MM[:SS] add time
  • -HH:MM[:SS] reduce time

{filename} can contain wildcards

Examples

  1. Set the modified-date from the exif-date:

    python easyexif.py m x *.jpg
  2. Set the EXIF-date from the modified-date:

    python easyexif.py x m *.jpg
    
  3. Set the EXIF-date and filename-prefix from the modified-date:

    python easyexif.py xn m *.jpg

    In addition to setting the exif-date, this will also prefix the modified-date to the filename using YYYYMMDD-HHMMSS~ format.

  4. Set the EXIF-date and modified-date from the filename:

    python easyexif.py xm n *.jpg

    Expects the filename to have a prefix of YYYYMMDD-HHMMSS~

  5. Set the EXIF-date and modified-date to the specified date:

    python easyexif.py xm 2022-01-01T01:02:03 *.jpg
  6. Add time to the EXIF-date and modified-date:

    python easyexif.py xm +01:02:03 *.jpg
    
  7. Reduce time from the EXIF-date and modified-date:

    python easyexif.py xm -01:02:03 *.jpg

Caveats

  • Only tested on Windows
  • {filename} should be a file/files, but not a directory (otherwise it tries to apply changes to the directory itself).

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

GNU Affero General Public License v3.0