# Renaming Photos

> Use when the user wants to rename photo files based on their EXIF shot date. Triggers when user says "rename my photos", "fix photo filenames", "sort photos by date", or invokes /rename-photos.

- Skill: `william-yeh/renaming-photos` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add william-yeh/renaming-photos`
- Raw SKILL.md: https://api.skillmd.com/api/skills/william-yeh/renaming-photos/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: william-yeh (https://skillmd.com/u/william-yeh)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/william-yeh/renaming-photos

---


# renaming-photos

Rename photo files based on EXIF `DateTimeOriginal` by running
`scripts/rename_photos.py` (requires `uv` and `exiftool`).

## Usage

When the user invokes `/rename-photos` or asks to rename photos by date:

```bash
uv run scripts/rename_photos.py [OPTIONS] DIR [DIR ...]
```

Options:
- `--tz +HH:MM` — force timezone offset (e.g. `--tz +08:00`)
- `--format STR` — strftime format string (default: `%Y-%m-%d %H.%M.%S`)
- `--dry-run` — print what would be renamed without doing it

## Behavior

- Recursively traverses each specified directory
- Supported formats: JPEG, HEIC, CR2, NEF, ARW, DNG, RAF, RW2, ORF, PEF, SRW
- Skips files with missing or suspicious EXIF dates (warns to stderr)
- Timezone: user `--tz` > `OffsetTimeOriginal` > as-is; adds ` +HHMM` suffix
  to filename when offset differs from local
- Conflict resolution: try bare name → append sub-second → append counter

