Created
June 9, 2015 19:36
-
-
Save mec/12256f620153935b2b8b to your computer and use it in GitHub Desktop.
Bash script to loop over a directory and fix the exif data to the date from the file name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
path=$1 | |
for file in $1/*; do | |
echo $file | |
filename=$(basename "$file" .mov) | |
filename=${filename//-/:} | |
filename=${filename//;/:} | |
echo "$filename" | |
exiftool -overwrite_original -FileModifyDate="$filename" -CreateDate="$filename" -ModifyDate="$filename" -TrackCreateDate="$filename" -TrackModifyDate="$filename" -MediaCreateDate="$filename" -MediaModifyDate="$filename" -CreationDate="$filename" "$file" | |
done | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment