From 6c2fb9a2fd9e3334ee7dabc1ad60bfc89158084f Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 27 Sep 2020 00:09:25 +1000 Subject: [PATCH] Tweak test/data/artif*/gif-transparent-index.gif --- script/make-artificial.go | 10 ++-- .../data/artificial/gif-transparent-index.gif | Bin 89 -> 165 bytes ...-transparent-index.gif.make-artificial.txt | 53 ++++++++++++++---- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/script/make-artificial.go b/script/make-artificial.go index 9de99abb..7ebfb132 100644 --- a/script/make-artificial.go +++ b/script/make-artificial.go @@ -959,7 +959,7 @@ outer: flags := uint8(0) duration := uint32(0) - transparentIndex := uint32(0) + transparentIndex := uint8(0) for s != "" { term := "" if i := strings.IndexByte(s, ' '); i >= 0 { @@ -980,12 +980,12 @@ outer: case term == "animationDisposalRestorePrevious": flags |= 0x0C case strings.HasPrefix(term, trans): - num, remaining, ok := parseNum(term[len(trans):]) - if !ok || remaining != "" { + num, err := strconv.ParseUint(term[len(trans):], 0, 8) + if err != nil { break outer } flags |= 0x01 - transparentIndex = num + transparentIndex = uint8(num) case strings.HasSuffix(term, ms): num, remaining, ok := parseNum(term[:len(term)-len(ms)]) if !ok || remaining != "" { @@ -1002,7 +1002,7 @@ outer: flags, uint8(duration>>0), uint8(duration>>8), - uint8(transparentIndex), + transparentIndex, 0x00, ) return stateGif, nil diff --git a/test/data/artificial/gif-transparent-index.gif b/test/data/artificial/gif-transparent-index.gif index a9f0e09a8771bc0b61584a8265c58a58164bf2e0..471ae7a09cc529238af835a307493df55e915cc7 100644 GIT binary patch literal 165 zcmZ?wbhEHbWMN=pXkh>W0R{#I1_lEL1_uU)00xEx28IF#h6V