Skip to content

Instantly share code, notes, and snippets.

@netologist
Last active May 18, 2017 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netologist/4bb48d67c0eb49a5ee6444a54b9037a5 to your computer and use it in GitHub Desktop.
Save netologist/4bb48d67c0eb49a5ee6444a54b9037a5 to your computer and use it in GitHub Desktop.
photos-date-changer.sh
#!/bin/bash
for folder in */ ; do
d1=${folder%%_*}
for file in "$folder"*; do
echo "$file"
if [[ $file =~ \.(avi|AVI|mpeg|mpg|mov|wmv|mp4)$ ]]; then
datestr=${d1//' '/'-'}
f=${file%%.*};
e=${file##*.};
ffmpeg -i "$file" -metadata ICRD="$d3 12:00:00" -c copy "${f}A.$e";
rm "$file"
else
datestr=${d1//' '/':'}
exiftool "-AllDates=$datestr 12:00:00" "$file";
rm "${file}_original"
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment