Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖

Genevieve Curry genevievecurry

🤖
View GitHub Profile
@genevievecurry
genevievecurry / bulk-image-processing.sh
Last active Mar 22, 2021
[Bulk Image Processing] Shell script that saves original, resizes, and compresses images.
View bulk-image-processing.sh
#!/bin/sh
# Go to the root of images folder
# Run for each type of image, for example, PNG:
# $ find . -type f -name '*.png' -exec ~/path/to/script/bulk-image-processing.sh {} \; 2>&1 | tee log-png.txt;
file="${1}"
basename=${file%.*}
extension="${file##*.}"
copiedFile="$basename"_"ORIGINAL.$extension"