Skip to content

Instantly share code, notes, and snippets.

@gzagatti
Last active February 10, 2023 21:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gzagatti/bf9f3c0d69678d48f0bc67ca32ae10bb to your computer and use it in GitHub Desktop.
Save gzagatti/bf9f3c0d69678d48f0bc67ca32ae10bb to your computer and use it in GitHub Desktop.
Deleting GPS tags from images using exiv2
# get the GPS keys from a random image
# we assume that all images have the same metadata fields,
# since they were obtained from the same device in similar conditions
export opts=$(exiv2 -p a IMG_2421.JPG | grep -i 'gps' | awk -F " " -v q='"' '{print "-M" q "del " $1 q}' | tr '\n' ' ')
# delete the keys from the metadata
for f in `ls`; do eval "exiv2 $opts $f"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment