Skip to content

Instantly share code, notes, and snippets.

@grimmo
Created July 26, 2017 12:33
Show Gist options
  • Save grimmo/41af3a91a5401ffb58b47fea4ed25da0 to your computer and use it in GitHub Desktop.
Save grimmo/41af3a91a5401ffb58b47fea4ed25da0 to your computer and use it in GitHub Desktop.
Set the timestamp via exiftool based on directory name structure
for foto in `find . -name "*.jpg" -not -path "*/.xvpics/*"` ; do DATAFOTO=`dirname $foto | cut -d '.' -f3,4 | cut -d '-' -f1 | sed -e 's/^/19/'| sed -e 's/[a-z]//g' | tr '.' ':' | sed -e 's/$/:01 00:00:00/'` ; if [ ${#DATAFOTO} -eq 19 ] ; then exiftool "-AllDates=$DATAFOTO" "$foto"; fi ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment