Skip to content

Instantly share code, notes, and snippets.

@trifo13
Created July 2, 2018 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trifo13/7fd8cc511acc62010b85502e0664a7a6 to your computer and use it in GitHub Desktop.
Save trifo13/7fd8cc511acc62010b85502e0664a7a6 to your computer and use it in GitHub Desktop.
bulk-scale-images.sh
#!/bin/bash
# Max Width
WIDTH=1200
# Max Height
HEIGHT=800
# Resize .jpg or .png to either height or width, preserve aspect ration:
find . -type f \( -name "*.jpg" -o -name "*.png" \) -exec convert \{} -verbose -resize $WIDTHx$HEIGHT\> \{} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment