-
-
Save blast-hardcheese/6724405 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
recurse_image_resize() { | |
for f in "$@"; do | |
if [ ! -d "$f" ]; then | |
echo "recurse_image_resize: '$f' is not a directory" | |
fi | |
for ff in "$f"/*.png; do | |
echo "resizing $ff to half size" | |
convert "$ff" -resize 50% "$ff"; | |
done | |
for dir in "$f/*/"; do | |
if [ -d "$dir" ]; then # If there are no subdirectories, glob won't expand. Test just to be sure. | |
recurse_image_resize "$dir" | |
fi | |
done | |
done | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment