Created
March 18, 2017 11:08
-
-
Save thinkingcap/0ba2a1ed631500900ae5f9540f818f94 to your computer and use it in GitHub Desktop.
This file contains 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
#! /bin/sh | |
# Usage A: | |
# optimise-images.sh /path/dir | |
# | |
# Usage B: | |
# cd /images/dir | |
# optimise-images.sh | |
EXT="jpe?g" | |
if [ -z "$1" ]; then | |
DIR="`pwd`" | |
else | |
DIR="$1" | |
fi | |
# Optimize JPEG images that are over 200k | |
find "$DIR" -regextype posix-egrep -regex ".*\.($EXT)\$" -type f -size +200k | xargs -I{} guetzli -quality 90 "{}" "{}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment