#!/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