fix: Add check for whether a WebP file is animated (cwebp does not support compressing animated files)
This commit is contained in:
parent
badc0d824f
commit
164641f5f7
1 changed files with 12 additions and 8 deletions
|
@ -28,6 +28,9 @@ loop_1(){
|
||||||
then
|
then
|
||||||
nice -n 10 oxipng -o max "${p}" #&> /dev/null
|
nice -n 10 oxipng -o max "${p}" #&> /dev/null
|
||||||
elif [[ "${p}" =~ .webp ]]
|
elif [[ "${p}" =~ .webp ]]
|
||||||
|
then
|
||||||
|
#If file is not animated
|
||||||
|
if [[ $(grep -v -q -e "ANIM" -e "ANMF" "${p}" ]]
|
||||||
then
|
then
|
||||||
nice -n 10 cwebp -mt -af -quiet "${p}" -o /tmp/temp.webp #&> /dev/null
|
nice -n 10 cwebp -mt -af -quiet "${p}" -o /tmp/temp.webp #&> /dev/null
|
||||||
if [[ -f /tmp/temp.webp ]]
|
if [[ -f /tmp/temp.webp ]]
|
||||||
|
@ -42,6 +45,7 @@ loop_1(){
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
cd "${folder}" || exit
|
cd "${folder}" || exit
|
||||||
|
|
Loading…
Add table
Reference in a new issue