Ciao a tutti! Io utilizzo Flickr per condividere le mie foto, e so quanto i dati Exif presenti nelle immagini jpeg possano essere considerati dei dati sensibili. Per queste ragioni, ho realizzato un semplice script in bash che rimuove tutti i tag Exif superflui, lasciando solamente quelli che ritengo fondamentali per una fotografia.
Lo script ha due opzioni:
- -s: mostra tutti i dati Exif
- -m: rimuove i dati Exif, lasciando solamente quelli importanti
Per esempio, puoi modificare una jpg con questo comando:
./ExifRemover.sh -m MyImg.jpg
Questo è lo script:
#! /bin/bash
function usage {
echo "usage: $0 -ms path_of_file"
echo " -m to remove useless exif entries"
echo " -s to show current exit entries"
exit -1
}
if [ $# != 2 ]; then
usage
fi
OP=$1
SRC=$2
if [ ! -f $SRC ]; then
echo "error: file not found"
exit -2
fi
if [ $OP = "-m" ]; then
cp "$SRC" "$SRC"."_tmp"
exiftool -all= "$SRC"
exiftool -overwrite_original \
-TagsFromFile "$SRC"."_tmp" \
-ExposureTime \
-FNumber \
-ExposureProgram \
-ISO \
-DateTimeOriginal \
-CreateDate \
-ExposureCompensation \
-MaxApertureValue \
-MeteringMode \
-LightSource \
-Flash \
-FocalLength \
-SubSecTime \
-SubSecTimeOriginal \
-SubSecTimeDigitized \
-ColorSpace \
-ExifImageWidth \
-ExifImageHeight \
-SensingMethod \
-CustomRendered \
-ExposureMode \
-WhiteBalance \
-DigitalZoomRatio \
-FocalLengthIn35mmFormat \
-SceneCaptureType \
-GainControl \
-Contrast \
-Saturation \
-Sharpness \
-SubjectDistanceRange \
-GPSVersionID \
-GPSLatitudeRef \
-GPSLatitude \
-GPSLongitudeRef \
-GPSLongitude \
-Make \
-Model \
"$SRC"
exiftool -delete_original! "$SRC"
rm -f "$SRC"."_tmp"
else
if [ $OP = "-s" ]; then
exiftool "$SRC"
else
usage
fi
fi
Download: ExifRemover.sh