An automated photo processing system that works with iOS Shortcuts to rename and organize photos based on their EXIF metadata.
This project consists of two parts:
- iOS Shortcut: Allows users to select photos and save them to a watched folder
- Deno Application: Monitors the folder, extracts EXIF data, renames files with creation timestamps, and moves them to a processed directory
- 📁 File Watching: Automatically detects new image files (HEIC, MOV, JPG, JPEG)
- 📸 EXIF Processing: Extracts creation date from photo metadata
- 🏷️ Smart Renaming: Formats filenames as
DD MMM YYYY HH:MM:SS_originalname - 📧 Error Notifications: Email alerts for processing issues
- 🧪 Well Tested: Comprehensive test suite with 90%+ coverage
- Deno installed
- Clone the repository:
git clone <repository-url>
cd rename-photo-file- Set up environment variables:
# Create .env file
echo "WATCHER_FOLDER_PATH=/path/to/your/watch/folder" > .env- Run the application:
# Development mode (watches src/example-assets)
deno task dev
# Production mode (watches WATCHER_FOLDER_PATH)
deno task start| Variable | Required | Description |
|---|---|---|
WATCHER_FOLDER_PATH |
Yes (prod) | Path to the folder to monitor for new photos |
NODE_ENV |
No | Set to prod for production mode |
- Create a new Shortcut in the Shortcuts app
- Add "Get Photos from Library" action
- Add "Save to Files" action pointing to your watch folder
- The app will automatically process new files
src/
├── modules/ # Core functionality
│ ├── exifReader.ts # EXIF data extraction
│ ├── renameFile.ts # File renaming logic
│ └── email.ts # Notification system
├── tests/ # Test files
├── types.ts # TypeScript definitions
├── constants.ts # Configuration constants
├── utils.ts # Utility functions
└── main.ts # Application entry point
deno test --allow-all# Format code
deno fmt
# Lint code
deno lint- File Detection: The app watches the specified folder for new image files
- EXIF Extraction: When a new file is detected, it reads the creation date from EXIF metadata
- Filename Generation: Creates a new filename format:
21 Oct 2024 23:20:34_originalname.ext - File Processing: Moves the renamed file to a
processedsubfolder - Completion Tracking: Writes a timestamp to
latest.txtwhen all files are processed
The application includes comprehensive error handling:
- Invalid or missing EXIF data
- File system errors
- Email notification failures
- Graceful recovery from processing errors
MIT License - see LICENSE file for details