Skip to content

Instantly share code, notes, and snippets.

@HadrienPatte
Last active January 9, 2021 15:03
Show Gist options
  • Save HadrienPatte/570e7d629c1b97ab4b29f3b6e1488bd2 to your computer and use it in GitHub Desktop.
Save HadrienPatte/570e7d629c1b97ab4b29f3b6e1488bd2 to your computer and use it in GitHub Desktop.
Sort and names photos
# This script renames and sorts photos and videos based on the time they were taken and the camera model
# Requires exif tag 'CreateDate' to be set
# Uses exif tag 'Model' if set
exiftool '-Directory<${CreateDate}' -d %Y/%m/%d -r -P -progress .
exiftool -if '$Model' '-FileName<${CreateDate}_${Model;tr/ /./;tr(/\\?*:,|"<>\0)()d}.%le' -execute -if 'not $Model' '-FileName<${CreateDate}.%le' -common_args -d %Y-%m-%d_%H.%M.%S%%-c -r -P -ext jpg -ext mov -ext mp4 -ext avi -ext wav -ext 3gp -progress .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment