From 8e817ad10b9a5aefa35d5623677489f883741738 Mon Sep 17 00:00:00 2001 From: Gregory Trolliet Date: Wed, 26 Oct 2022 18:16:58 +0200 Subject: [PATCH] [SCRIPTS] Add png compression with pndquant --- .scripts/generate_tumbnails.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.scripts/generate_tumbnails.sh b/.scripts/generate_tumbnails.sh index 389116b..3bd6cb1 100755 --- a/.scripts/generate_tumbnails.sh +++ b/.scripts/generate_tumbnails.sh @@ -28,6 +28,7 @@ thumbnail(){ jpegq=75 webpq=55 cavifq=35 + pngq="60-90" # Si une image est un thumbnail on la considère comme déjà bien traitée. if [[ $2 == *".thumb."* ]]; then @@ -56,6 +57,7 @@ thumbnail(){ pngcrush -warn "$2" "$2.tmp" mv -f "$2.tmp" "$2" /usr/bin/convert -resize $maxwidth\> "$2" "$thumbname" + /usr/bin/pngquant --quality=$pngq --skip-if-larger --force --transbug "$thumbname" -o "$thumbname" /usr/bin/convert -resize $maxwidth\> -quality $webpq "$2" "$thumbwebpname" pngcrush -warn "$thumbname" "$thumbname.tmp" mv -f "$thumbname.tmp" "$thumbname"