Skip to content

Commit

Permalink
Add frame count to output when building GIFs
Browse files Browse the repository at this point in the history
  • Loading branch information
norm committed Nov 13, 2021
1 parent 0d3c286 commit 04af4a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/make_gif
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ function main {


mv "$TEMP/gifsicle.${losses}.gif" "$gif"

frames=$(
gifsicle --info "$gif" \
| grep \+\ image \
| tail -1 \
| sed -e 's/^ . image .//' -e 's/ .*$//'
)
echo " > $frames frames"
}

function palettegen_filter {
Expand Down
1 change: 1 addition & 0 deletions tests/make_gifs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ reset=$'\e'[0m
[ "${lines[1]}" == " 64 colours (64 initially)" ]
[ "${lines[2]}" == " size 1.61mb (duration 1.01) $magenta[auto max 0.45mb]$reset" ]
[ "${lines[3]}" == " $cyan< optimised with loss 0, now 1.48mb, 92.3% of original$reset" ]
[ "${lines[4]}" == " > 29 frames" ]
# cp $BATS_TMPDIR/output.gif tests/gifs/original.gif
diff -u $BATS_TMPDIR/output.gif tests/gifs/original.gif
}
Expand Down

0 comments on commit 04af4a4

Please sign in to comment.