26s/tools/limpia-img.sh
hacklab f78773bb87 Web de la acampada del 26S
Home con directo, comunicados y organización. HTML y CSS, sin JS.
Configuración de nginx, timer del directo y limpieza de EXIF.
2026-09-29 10:10:54 +02:00

26 lines
781 B
Bash
Executable file

#!/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