From 43809f833242a853859e69bd9b636b8cdfb0aa9d Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 4 May 2022 15:45:53 +0200 Subject: [PATCH] Fix some small issues in apng2webp --- .config/zsh/functions/apng2webp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/zsh/functions/apng2webp b/.config/zsh/functions/apng2webp index 8d7cffd..f24ce62 100755 --- a/.config/zsh/functions/apng2webp +++ b/.config/zsh/functions/apng2webp @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# Convert animated PNG to animated WebP. Maximum compression no blend. +# Convert animated PNG to animated WebP. Maximum lossless compression no blend. setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL @@ -33,14 +33,14 @@ for file in apngdis/apngframe*.png; do done local -a webpmux_options=() -local counter=1 +local -i counter=1 for file in apngdis/apngframe*.txt; do local delay=$(grep -Po '=\d+/' "${file}") delay=${delay:1:-1} [[ ${#o_delay} -eq 2 ]] && delay=${o_delay[2]} - webpmux_options+=(-frame $(printf "%02d" ${counter}).webp +${delay}+0+0+0-b) - counter=$((counter+1)) + webpmux_options+=(-frame $(printf "%02d.webp" ${counter}) +${delay}+0+0+0-b) + counter+=1 done # shellcheck disable=2086