Add Exif date for the missing
✓ Published0🌍 Public
Aadkdev
Last edited Aug 2, 2021
Created on Aug 2, 2021
This example demonstrates a Python script that fills in missing EXIF date metadata for image files by parsing dates embedded in filenames. It processes all images in a local `./img/` directory, checking whether each file already contains EXIF data before adding `DateTimeOriginal` and `DateTimeDigitized` tags using the `piexif` library. The script extracts the date from the filename format `_YYYYMMDD_HHMMSS`, converts it to the standard EXIF format, and writes it back into the image file with `piexif.insert`. Files that already have EXIF data are skipped.
AI-generated description