ð« The Pain Point
Your camera names photos IMG_0001.jpg, IMG_0002.jpg⊠You want them named by date: 2024-01-15_143052.jpg for chronological sorting.
ð Agentic Solution
An EXIF-Based Renamer that uses photo metadata for meaningful names.
Key Features:
- Date Extraction: Uses DateTimeOriginal from EXIF.
- Custom Patterns:
{year}-{month}-{day}_{hour}{minute}{second}. - Duplicate Handling: Adds suffix for same-second photos.
âïž Phase 1: Commander (Quick Fix)
For quick renaming.
Prompt:
âI have a folder
photoswith images. Write a Python script using Pillow to:
- Read EXIF: Extract DateTimeOriginal from each image.
- Rename: To format
YYYY-MM-DD_HHMMSS.jpg.- Duplicates: Add suffix
_1,_2if same timestamp.- No EXIF: Use file creation date as fallback.
Preview renames first, apply with
--applyflag.â
Result: Chronologically organized photo library.
ðïž Phase 2: Architect (Permanent Tool)
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create an "EXIF-Based Renamer".
**Requirements:**
1. **GUI:**
* Select folder.
* Pattern builder with EXIF fields.
* Preview table (old â new).
* Handle no-EXIF options.
* Apply button.
2. **Logic:**
* Read EXIF with exifread or piexif.
* Fallback to file date.
* Duplicate detection.
3. **Deliverables:**
* `exif_rename.py`
* `run.bat`, `run.sh`
* `requirements.txt`
ð§ Prompt Decoding
- DateTimeOriginal: The timestamp when the photo was actually taken, not when the file was copied.
ð ïž Instructions
- Install:
pip install pillow piexif - Copy Prompt â Preview â Apply.