Skip to content

Instantly share code, notes, and snippets.

@ivanxuu
Last active February 6, 2016 11:52
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 ivanxuu/0775e7dfe1ddc9974e6a to your computer and use it in GitHub Desktop.
Save ivanxuu/0775e7dfe1ddc9974e6a to your computer and use it in GitHub Desktop.
rename pictures using exiftool conditionaly for geolocated pictures
#!/usr/bin/env sh
if [ -f "$1" ] ; then
echo "Geotaging non geolocated pictures"
# Find only non geolocated pictures
exiftool -geotag $1 -overwrite_original -if 'not $gpslongitude' *
else
echo "Skiping geolocating picture due to not track provided."
echo " Provide track with 'renamepics.sh track.gpx'\n"
fi
echo "\nRenaming pictures"
exiftool '-filename<${datetimeoriginal}.ID${ShutterCount}.nogeo.${FileType}' -d "%Y%m%d%H%M%S" -if 'not $gpslongitude' *
exiftool '-filename<${datetimeoriginal}.ID${ShutterCount}.geo.${FileType}' -d "%Y%m%d%H%M%S" -if 'not not $gpslongitude' *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment