fix: Make detections for GIF/WebM more precise
This commit is contained in:
parent
e7b88efe81
commit
1cd916e184
1 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,8 @@ loop_1(){
|
||||||
#Specific compression for large GIF files
|
#Specific compression for large GIF files
|
||||||
while [[ $(stat -c%s "${p}" || 0) -ge 512000 ]]
|
while [[ $(stat -c%s "${p}" || 0) -ge 512000 ]]
|
||||||
do
|
do
|
||||||
nice -n 10 gifsicle "${p}" $(seq -f "#%g" 0 2 99) -O3 --lossy=80 --colors=255 -o "${p}" #&> /dev/null
|
frameamount=$(exiftool -b -FrameCount "${p}" || 1)
|
||||||
|
nice -n 10 gifsicle "${p}" $(seq -f "#%g" 0 2 "${frameamount}") -O3 --lossy=80 --colors=255 -o "${p}" #&> /dev/null
|
||||||
done
|
done
|
||||||
elif [[ "${p}" =~ .png ]]
|
elif [[ "${p}" =~ .png ]]
|
||||||
then
|
then
|
||||||
|
@ -30,7 +31,7 @@ loop_1(){
|
||||||
elif [[ "${p}" =~ .webp ]]
|
elif [[ "${p}" =~ .webp ]]
|
||||||
then
|
then
|
||||||
#If file is not animated
|
#If file is not animated
|
||||||
if [[ $(grep -v -q -e "ANIM" -e "ANMF" "${p}") ]]
|
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 ]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue