#!/bin/sh # Quita metadatos (EXIF, GPS, modelo de móvil) de las imágenes antes de subirlas. # Uso: tools/limpia-img.sh foto1.jpg foto2.png ... # Necesita exiftool (libimage-exiftool-perl) o mat2. set -eu [ $# -gt 0 ] || { echo "uso: $0 imagen..." >&2; exit 1; } if command -v exiftool >/dev/null 2>&1; then exiftool -all= -overwrite_original -- "$@" elif command -v mat2 >/dev/null 2>&1; then for f in "$@"; do mat2 --inplace -- "$f" done else echo "falta exiftool o mat2" >&2 exit 1 fi # comprobación: no debe quedar GPS if command -v exiftool >/dev/null 2>&1; then if exiftool -q -q -if '$GPSLatitude' -p '$FileName' -- "$@" 2>/dev/null | grep .; then echo "ojo: quedan coordenadas GPS en las de arriba" >&2 exit 1 fi fi