Add EXIF/metadata date fallback and extension filtering to Move-PhotosByDate #1

Merged
hannah-vernon merged 1 commit from feature/exif-fallback-and-extension-filtering into dev 2026-07-08 16:54:37 -05:00

What does this PR do?

Adds extension filtering and an EXIF/metadata date fallback to Move-PhotosByDate.ps1.

  • -Extension - the set of extensions to process, defaulting to a list of common image types. Supplying it replaces the default image list.
  • -IncludeVideo - also processes common video extensions.
  • -ExifFallback - when a filename has no valid yyyyMMdd date, reads the embedded capture date from file metadata. Photos use true EXIF DateTimeOriginal (tag 0x9003) via System.Drawing, falling back to the Windows Shell "Date taken" property; videos use the Windows Shell "Media created" property. The filename date always takes precedence when present and valid.

The summary object now also reports ResolvedByExif and Excluded counts.

How was this tested?

  • Script parses cleanly ([System.Management.Automation.Language.Parser]::ParseFile reports 0 errors)
  • Manually tested with a throwaway temp folder:
    • Default run: date-named images moved into Year\yyyy-MM-dd; a .mp4 and a .txt excluded; an EXIF-only image skipped (no -ExifFallback).
    • -IncludeVideo -ExifFallback run: .mp4 moved by filename date, date-named image moved, an image with no date in its name resolved via EXIF DateTimeOriginal to the correct Year\yyyy-MM-dd folder (ResolvedByExif = 1), .txt excluded.

Checklist

  • I have read the Contributing Guide
  • Changes are focused - one logical change per PR
  • Documentation updated (README and agent-readme)
  • New dependencies are MIT/Apache-2.0 and security-vetted (none added; uses built-in System.Drawing and the Shell.Application COM object)
  • No commented-out code or debug leftovers
## What does this PR do? Adds extension filtering and an EXIF/metadata date fallback to `Move-PhotosByDate.ps1`. - `-Extension` - the set of extensions to process, defaulting to a list of common image types. Supplying it replaces the default image list. - `-IncludeVideo` - also processes common video extensions. - `-ExifFallback` - when a filename has no valid `yyyyMMdd` date, reads the embedded capture date from file metadata. Photos use true EXIF `DateTimeOriginal` (tag `0x9003`) via `System.Drawing`, falling back to the Windows Shell "Date taken" property; videos use the Windows Shell "Media created" property. The filename date always takes precedence when present and valid. The summary object now also reports `ResolvedByExif` and `Excluded` counts. ## How was this tested? - [x] Script parses cleanly (`[System.Management.Automation.Language.Parser]::ParseFile` reports 0 errors) - [x] Manually tested with a throwaway temp folder: - Default run: date-named images moved into `Year\yyyy-MM-dd`; a `.mp4` and a `.txt` excluded; an EXIF-only image skipped (no `-ExifFallback`). - `-IncludeVideo -ExifFallback` run: `.mp4` moved by filename date, date-named image moved, an image with no date in its name resolved via EXIF `DateTimeOriginal` to the correct `Year\yyyy-MM-dd` folder (`ResolvedByExif = 1`), `.txt` excluded. ## Checklist - [x] I have read the Contributing Guide - [x] Changes are focused - one logical change per PR - [x] Documentation updated (README and agent-readme) - [x] New dependencies are MIT/Apache-2.0 and security-vetted (none added; uses built-in System.Drawing and the Shell.Application COM object) - [x] No commented-out code or debug leftovers
Add -Extension (defaulting to common image types), -IncludeVideo, and -ExifFallback
parameters. Files are now limited to a configurable extension set. When a filename
lacks a valid yyyyMMdd date and -ExifFallback is supplied, the capture date is read
from EXIF DateTimeOriginal (via System.Drawing) for photos, falling back to the
Windows Shell property system (Date taken / Media created) for portability and video
support. The filename date still takes precedence. The summary object now reports
ResolvedByExif and Excluded counts. README and agent-readme updated accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hannah-vernon/camera-roll-tools!1
No description provided.