Last active
April 16, 2025 15:25
-
Star
(119)
You must be signed in to star a gist -
Fork
(23)
You must be signed in to fork a gist
Revisions
-
tabrindle revised this gist
Mar 9, 2016 . 1 changed file with 4 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,15 @@ #!/bin/bash PARAMS=('-m 6 -q 70 -mt -af -progress') if [ $# -ne 0 ]; then PARAMS=$@; fi cd $(pwd) shopt -s nullglob nocaseglob extglob for FILE in *.@(jpg|jpeg|tif|tiff|png); do cwebp $PARAMS "$FILE" -o "${FILE%.*}".webp; done -
tabrindle created this gist
Mar 9, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/bin/bash quality=75; if [ $# -ne 0 ]; then quality="$1"; if ![[ "$quality" =~ "^[0-9]+$" ]]; then echo "Error: Quality parameter not a number" >&2; exit 1 fi fi cd $(pwd) shopt -s nullglob nocaseglob extglob for FILE in *.@(jpg|jpeg|tif|tiff|bmp|png); do cwebp -af -q "$quality" "$FILE" -o "${FILE%.*}".webp; done