Last active
February 23, 2019 17:05
-
-
Save schellenbergk/870d263ca4a7018d8fe36f8e787b1a25 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/bash | |
# usage examples: | |
# toWebP.sh "*.png" # convert all png's in current directory | |
# toWebP.sh "icon-*.jpg" # convert all jpg's that start with "icon-" | |
if [ $# -eq 0 -o -z "$1" ]; then | |
echo "No file pattern supplied"; | |
exit 1; | |
fi | |
for file in $1 | |
do | |
echo "Converting $file"; | |
cwebp -q 80 "$file" -o "${file%.*}.webp" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment