Skip to content

Instantly share code, notes, and snippets.

@schellenbergk schellenbergk/toWebP.sh
Last active Feb 23, 2019

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.