File tree 2 files changed +21
-1
lines changed 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,6 @@ func (d *decoder) readHeaderAndScreenDescriptor() error {
271
271
}
272
272
}
273
273
// d.tmp[12] is the Pixel Aspect Ratio, which is ignored.
274
- d .loopCount = - 1
275
274
return nil
276
275
}
277
276
Original file line number Diff line number Diff line change @@ -253,3 +253,24 @@ func TestPixelOutsidePaletteRange(t *testing.T) {
253
253
try (t , b .Bytes (), want )
254
254
}
255
255
}
256
+
257
+ func TestLoopCount (t * testing.T ) {
258
+ data := []byte ("GIF89a000\x00 000,0\x00 \x00 \x00 \n \x00 " +
259
+ "\n \x00 \x80 000000\x02 \b \xf0 1u\xb9 \xfd al\x05 \x00 ;" )
260
+ img , err := DecodeAll (bytes .NewReader (data ))
261
+ if err != nil {
262
+ t .Fatal ("DecodeAll:" , err )
263
+ }
264
+ w := new (bytes.Buffer )
265
+ err = EncodeAll (w , img )
266
+ if err != nil {
267
+ t .Fatal ("EncodeAll:" , err )
268
+ }
269
+ img1 , err := DecodeAll (w )
270
+ if err != nil {
271
+ t .Fatal ("DecodeAll:" , err )
272
+ }
273
+ if img .LoopCount != img1 .LoopCount {
274
+ t .Errorf ("loop count mismatch: %d vs %d" , img .LoopCount , img1 .LoopCount )
275
+ }
276
+ }
You can’t perform that action at this time.
0 commit comments