blog-contributions/nix/packages/metadata-scrub/metadata-scrub.sh
2025-02-11 16:17:34 +01:00

20 lines
526 B
Bash

# Check if a folder is provided
if [[ -z "$1" ]]; then
echo "Usage: $0 <folder>"
exit 1
fi
FOLDER="$1"
# Ensure the folder exists
if [[ ! -d "$FOLDER" ]]; then
echo "Error: Folder '$FOLDER' not found."
exit 1
fi
# Recursively find and scrub metadata from all image files
find "$FOLDER" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.tiff" -o -iname "*.bmp" \) -exec exiftool -overwrite_original -all= {} \;
echo "✅ Metadata removed from all images in '$FOLDER'."