the home site for me: also iteration 3 or 4 of my site
1#!/usr/bin/env bash
2
3# Check if exiftool is installed
4if ! command -v exiftool &> /dev/null; then
5 echo "Error: exiftool is not installed. Please install it." >&2
6 exit 1
7fi
8
9while read -r file; do
10 case "$file" in
11 *.jpg|*.jpeg|*.png|*.gif|*.tiff|*.bmp)
12 # Store output of exiftool command
13 cleared_data=$(exiftool -all= --icc_profile:all -tagsfromfile @ -orientation -overwrite_original "$file")
14 if [ $? -ne 0 ]; then
15 echo "Error: exiftool failed to process $file" >&2
16 exit 1
17 fi
18 echo "Cleared EXIF data for $file:" >&2
19 echo "$cleared_data" >&2
20 git add "$file"
21 ;;
22 *)
23 ;;
24 esac
25done < <(git diff --cached --name-only --diff-filter=ACMR)
26
27exit 0