A Command to Sync EXIF Data with File System Timestamps
I recently embarked on a journey to digitize my old photographs. Since mypre-digital photos exist only as physical prints, I decided to invest in aPFU scanner to bring these memories into the digital age. The scanner's performance has been impressive - it handled even my old San Francisco business trip photos from 2001 beautifully, producing crisp, clear scans. Unlike photos taken with a digital camera, scanned images don't come with proper EXIF data. To preserve the actual capture dates of these photos, I used exiftool from the command line to set the correct EXIF information: This command successfully embeds the correct capture date in the photo's EXIF data. For managing my photo files, I rely on Hazel, a powerful file organization tool for Mac. Hazel offers some fantastic automation features: However, Hazel has one limitation that's been bugging me: it can't directly read EXIF data. This means that even though I've carefully added the correct capture dates to the EXIF data, I can't use this information for Hazel's automated organization. To bridge this gap, I created a script that syncs EXIF information with the file system timestamps (creation and modification dates). This enables Hazel to organize photos based on their actual capture dates. The script provides the following features: Create a file named "adj-photodate" and paste the following script: Make it executable: Optionally, move it to your path: Dependencies: To see available options:Setting EXIF Information
# Example: Setting the original capture date
exiftool "-DateTimeOriginal=2001:04:15 10:00:00" photo.jpgThe Photo Organization
The Solution: adj-photodate Script
DateTimeOriginal from EXIF to file system timestampsInstallation
chmod +x adj-photodatecp adj-photodate ~/bin/Usage
# Process a single file
./adj-photodate photo.jpg
# Preview changes with dry-run
./adj-photodate -n photo.jpg
# Process all JPEG files in a directory recursively
./adj-photodate -r ~/Pictures/Scanned./adj-photodate --help