Last active
February 6, 2016 11:52
-
-
Save ivanxuu/0775e7dfe1ddc9974e6a to your computer and use it in GitHub Desktop.
rename pictures using exiftool conditionaly for geolocated pictures
This file contains hidden or 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
#!/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