Use 0 (not 1) num_animation_loops for still GIFs

For example, the crc32 checksums in test/nia-checksums-of-data.txt for
test/data/pjw-thumbnail.{bmp,gif,png} now all match.
This commit is contained in:
Nigel Tao committed 2021-11-23 15:06:55 +11:00
1 parent 8bd52a8791
commit ac4d3e6420
4 files changed
+44 -22

No files matched your search

+11 -6
View File
@@ -252,11 +252,6 @@ do_test_wuffs_gif_decode(const char* filename,
CHECK_STATUS("set_from_slice", wuffs_base__pixel_buffer__set_from_slice(
&pb, &ic.pixcfg, g_pixel_slice_u8));
uint32_t have = wuffs_gif__decoder__num_animation_loops(&dec);
if (have != 1) {
RETURN_FAIL("num_animation_loops: have %" PRIu32 ", want 1", have);
}
}
int num_iters = 0;
@@ -422,6 +417,16 @@ do_test_wuffs_gif_decode(const char* filename,
}
}
{
uint32_t have = wuffs_gif__decoder__num_animation_loops(&dec);
uint32_t want =
(wuffs_gif__decoder__num_decoded_frame_configs(&dec) > 1) ? 1 : 0;
if (have != want) {
RETURN_FAIL("num_animation_loops: have %" PRIu32 ", want %" PRIu32, have,
want);
}
}
return NULL;
}
@@ -1510,7 +1515,7 @@ test_wuffs_gif_decode_multiple_loop_counts() {
// loop counts are the number of animation loops *after* the first play
// through, and Wuffs' are the number *including* the first play through.
uint32_t want_num_animation_loops[4] = {1, 1, 51, 31};
uint32_t want_num_animation_loops[4] = {0, 1, 51, 31};
uint32_t i = 0;
while (true) {