1
0
Fork 0

remove-orientation.sh

master
dece 8 months ago
parent 08f2735f82
commit 5a18b172cc

@ -0,0 +1,28 @@
#!/bin/bash
# Remove orientation information from the EXIF metadata WITHOUT touching pixels.
# Can also remove thumbnail because some programs like Ristretto are bugged by
# the remaining thumbnail orientation metadata. Useful when a photo has wrong
# orientation metadata (e.g. buggy LineageOS app).
usage() {
echo "Usage: $0 [-t] [FILE]"
echo " -t remove thumbnail"
}
OPT_FLAG_T=
while getopts "ht" OPTION; do
case $OPTION in
h) usage; exit 0 ;;
t) OPT_FLAG_T=true ;;
*) usage; exit 1 ;;
esac
done
shift $(( OPTIND - 1 ))
for jpg in "$@"; do
echo "Fixing \"$jpg\"…"
exiftool -Orientation= -overwrite_original "$jpg"
if [[ "$OPT_FLAG_T" = true ]]; then
exiftool -IFD1:all= -overwrite_original "$jpg"
fi
done
Loading…
Cancel
Save