scripts: convert: another change quality

This commit is contained in:
Mateusz Słodkowicz 2024-08-23 18:47:47 +02:00
parent 1381df6297
commit b5fa9e6f4c
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ IFS=$'\n'
CONVERT="$(nix eval nixpkgs\#imagemagick.outPath | tr -d '"')/bin/convert"
convert_cmd () {
if ! command -v convert &> /dev/null; then $CONVERT "$@"; else convert "$@"; fi
if ! command -v magick &> /dev/null; then $CONVERT "$@"; else convert "$@"; fi
}
@ -19,7 +19,7 @@ change_to_webp() {
file="${f%.*}"
file_webp="${file}.webp"
echo "Trying to convert to $file_webp"
if convert_cmd "$f" "$file_webp"; then
if convert_cmd "$f" -define webp:thread-level=1 -define webp:method=6 -quality 99 "$file_webp"; then
if touch -r "$f" "$file_webp"; then
rm "$f"
echo "Finished converting $f"