From bd30b3bf51344f92beedf95082ad70fca66d8075 Mon Sep 17 00:00:00 2001 From: Randy Date: Thu, 1 Jun 2023 01:22:47 +0300 Subject: [PATCH 1/9] meson: tests now require APNG support in libpng Debian includes APNG support with libpng, but homebrew and other platforms don't. The fallback wrap should also include APNG support. --- tests/meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/meson.build b/tests/meson.build index 568c7663..f7490664 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -27,6 +27,10 @@ write_fuzzer_exe = executable('fuzz_write_repro', png_dep = dependency('libpng', version : '>=1.6.0', fallback : ['libpng', 'png_dep']) +if not cc.has_function('png_get_acTL', prefix : '#include ', dependencies : png_dep) + error('Tests require libpng with Animated PNG (APNG) support') +endif + test_deps = [ spng_dep, png_dep ] test_exe = executable('testsuite', 'testsuite.c', dependencies : test_deps) From 143623bea4984fc234b55f640cdb4e18ef77230c Mon Sep 17 00:00:00 2001 From: Randy Date: Thu, 1 Jun 2023 04:48:26 +0300 Subject: [PATCH 2/9] update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 76962154..79055b43 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /check_build/ /benchmark_images/ /subprojects/*/ +!/subprojects/packagefiles /.vscode/ /.frama-c/ /trash/ From 2dc77382f590aa1b116d99761be09e5b82c8305f Mon Sep 17 00:00:00 2001 From: Randy Date: Thu, 1 Jun 2023 18:38:23 +0300 Subject: [PATCH 3/9] meson: update libpng.wrap to 1.6.39, add APNG patch --- subprojects/libpng.wrap | 19 +- .../apng/libpng-1.6.39-apng.patch | 1728 +++++++++++++++++ tests/meson.build | 10 +- 3 files changed, 1748 insertions(+), 9 deletions(-) create mode 100644 subprojects/packagefiles/apng/libpng-1.6.39-apng.patch diff --git a/subprojects/libpng.wrap b/subprojects/libpng.wrap index b7af9091..85d3c4b1 100644 --- a/subprojects/libpng.wrap +++ b/subprojects/libpng.wrap @@ -1,10 +1,15 @@ [wrap-file] -directory = libpng-1.6.37 +directory = libpng-1.6.39 -source_url = https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz -source_filename = libpng-1.6.37.tar.gz -source_hash = ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307 +source_url = https://github.com/glennrp/libpng/archive/v1.6.39.tar.gz +source_filename = libpng-1.6.39.tar.gz +source_hash = a00e9d2f2f664186e4202db9299397f851aea71b36a35e74910b8820e380d441 -patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.37/1/get_zip -patch_filename = libpng-1.6.37-1-wrap.zip -patch_hash = 9a863ae8a5657315a484c94c51f9f636b1fb9f49a15196cc896b72e5f21d78f0 +patch_url = https://wrapdb.mesonbuild.com/v2/libpng_1.6.39-3/get_patch +patch_filename = libpng_1.6.39-3_patch.zip +patch_hash = 6af2a8d464e3f1d2e2832580896323ac7b0b786806c75f0eff0c8ec82dd603ec + +diff_files = apng/libpng-1.6.39-apng.patch + +[provide] +libpng = libpng_dep diff --git a/subprojects/packagefiles/apng/libpng-1.6.39-apng.patch b/subprojects/packagefiles/apng/libpng-1.6.39-apng.patch new file mode 100644 index 00000000..0b9c56d0 --- /dev/null +++ b/subprojects/packagefiles/apng/libpng-1.6.39-apng.patch @@ -0,0 +1,1728 @@ +diff -Naru libpng-1.6.39.org/png.h libpng-1.6.39/png.h +--- libpng-1.6.39.org/png.h 2022-11-24 08:37:51.507052183 +0900 ++++ libpng-1.6.39/png.h 2022-11-24 08:41:17.785489740 +0900 +@@ -330,6 +330,10 @@ + # include "pnglibconf.h" + #endif + ++#define PNG_APNG_SUPPORTED ++#define PNG_READ_APNG_SUPPORTED ++#define PNG_WRITE_APNG_SUPPORTED ++ + #ifndef PNG_VERSION_INFO_ONLY + /* Machine specific configuration. */ + # include "pngconf.h" +@@ -425,6 +429,17 @@ + * See pngconf.h for base types that vary by machine/system + */ + ++#ifdef PNG_APNG_SUPPORTED ++/* dispose_op flags from inside fcTL */ ++#define PNG_DISPOSE_OP_NONE 0x00U ++#define PNG_DISPOSE_OP_BACKGROUND 0x01U ++#define PNG_DISPOSE_OP_PREVIOUS 0x02U ++ ++/* blend_op flags from inside fcTL */ ++#define PNG_BLEND_OP_SOURCE 0x00U ++#define PNG_BLEND_OP_OVER 0x01U ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +@@ -746,6 +761,10 @@ + #define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ + #define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ + #define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */ ++#ifdef PNG_APNG_SUPPORTED ++#define PNG_INFO_acTL 0x20000U ++#define PNG_INFO_fcTL 0x40000U ++#endif + + /* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using +@@ -783,6 +802,10 @@ + #ifdef PNG_PROGRESSIVE_READ_SUPPORTED + typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); + typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); ++#ifdef PNG_APNG_SUPPORTED ++typedef PNG_CALLBACK(void, *png_progressive_frame_ptr, (png_structp, ++ png_uint_32)); ++#endif + + /* The following callback receives png_uint_32 row_number, int pass for the + * png_bytep data of the row. When transforming an interlaced image the +@@ -3226,6 +3249,74 @@ + /******************************************************************************* + * END OF HARDWARE AND SOFTWARE OPTIONS + ******************************************************************************/ ++#ifdef PNG_APNG_SUPPORTED ++PNG_EXPORT(250, png_uint_32, png_get_acTL, (png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); ++ ++PNG_EXPORT(251, png_uint_32, png_set_acTL, (png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); ++ ++PNG_EXPORT(252, png_uint_32, png_get_num_frames, (png_structp png_ptr, ++ png_infop info_ptr)); ++ ++PNG_EXPORT(253, png_uint_32, png_get_num_plays, (png_structp png_ptr, ++ png_infop info_ptr)); ++ ++PNG_EXPORT(254, png_uint_32, png_get_next_frame_fcTL, ++ (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, ++ png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, ++ png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, ++ png_byte *blend_op)); ++ ++PNG_EXPORT(255, png_uint_32, png_set_next_frame_fcTL, ++ (png_structp png_ptr, png_infop info_ptr, png_uint_32 width, ++ png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op)); ++ ++PNG_EXPORT(256, png_uint_32, png_get_next_frame_width, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(257, png_uint_32, png_get_next_frame_height, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(258, png_uint_32, png_get_next_frame_x_offset, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(259, png_uint_32, png_get_next_frame_y_offset, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(260, png_uint_16, png_get_next_frame_delay_num, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(261, png_uint_16, png_get_next_frame_delay_den, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(262, png_byte, png_get_next_frame_dispose_op, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(263, png_byte, png_get_next_frame_blend_op, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(264, png_byte, png_get_first_frame_is_hidden, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(265, png_uint_32, png_set_first_frame_is_hidden, ++ (png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++PNG_EXPORT(266, void, png_read_frame_head, (png_structp png_ptr, ++ png_infop info_ptr)); ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++PNG_EXPORT(267, void, png_set_progressive_frame_fn, (png_structp png_ptr, ++ png_progressive_frame_ptr frame_info_fn, ++ png_progressive_frame_ptr frame_end_fn)); ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++PNG_EXPORT(268, void, png_write_frame_head, (png_structp png_ptr, ++ png_infop info_ptr, png_bytepp row_pointers, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op)); ++ ++PNG_EXPORT(269, void, png_write_frame_tail, (png_structp png_ptr, ++ png_infop info_ptr)); ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++#endif /* PNG_APNG_SUPPORTED */ + + /* Maintainer: Put new public prototypes here ^, in libpng.3, in project + * defs, and in scripts/symbols.def. +@@ -3235,7 +3326,11 @@ + * one to use is one more than this.) + */ + #ifdef PNG_EXPORT_LAST_ORDINAL ++#ifdef PNG_APNG_SUPPORTED ++ PNG_EXPORT_LAST_ORDINAL(269); ++#else + PNG_EXPORT_LAST_ORDINAL(249); ++#endif /* PNG_APNG_SUPPORTED */ + #endif + + #ifdef __cplusplus +diff -Naru libpng-1.6.39.org/pngget.c libpng-1.6.39/pngget.c +--- libpng-1.6.39.org/pngget.c 2022-11-24 08:37:51.507052183 +0900 ++++ libpng-1.6.39/pngget.c 2022-11-24 08:41:17.785489740 +0900 +@@ -1246,4 +1246,166 @@ + # endif + #endif + ++#ifdef PNG_APNG_SUPPORTED ++png_uint_32 PNGAPI ++png_get_acTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 *num_frames, png_uint_32 *num_plays) ++{ ++ png_debug1(1, "in %s retrieval function", "acTL"); ++ ++ if (png_ptr != NULL && info_ptr != NULL && ++ (info_ptr->valid & PNG_INFO_acTL) && ++ num_frames != NULL && num_plays != NULL) ++ { ++ *num_frames = info_ptr->num_frames; ++ *num_plays = info_ptr->num_plays; ++ return (1); ++ } ++ ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_num_frames(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_num_frames()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->num_frames); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_num_plays(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_num_plays()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->num_plays); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 *width, png_uint_32 *height, ++ png_uint_32 *x_offset, png_uint_32 *y_offset, ++ png_uint_16 *delay_num, png_uint_16 *delay_den, ++ png_byte *dispose_op, png_byte *blend_op) ++{ ++ png_debug1(1, "in %s retrieval function", "fcTL"); ++ ++ if (png_ptr != NULL && info_ptr != NULL && ++ (info_ptr->valid & PNG_INFO_fcTL) && ++ width != NULL && height != NULL && ++ x_offset != NULL && y_offset != NULL && ++ delay_num != NULL && delay_den != NULL && ++ dispose_op != NULL && blend_op != NULL) ++ { ++ *width = info_ptr->next_frame_width; ++ *height = info_ptr->next_frame_height; ++ *x_offset = info_ptr->next_frame_x_offset; ++ *y_offset = info_ptr->next_frame_y_offset; ++ *delay_num = info_ptr->next_frame_delay_num; ++ *delay_den = info_ptr->next_frame_delay_den; ++ *dispose_op = info_ptr->next_frame_dispose_op; ++ *blend_op = info_ptr->next_frame_blend_op; ++ return (1); ++ } ++ ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_width(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_width()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_width); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_height(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_height()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_height); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_x_offset(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_x_offset()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_x_offset); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_y_offset(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_y_offset()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_y_offset); ++ return (0); ++} ++ ++png_uint_16 PNGAPI ++png_get_next_frame_delay_num(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_delay_num()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_delay_num); ++ return (0); ++} ++ ++png_uint_16 PNGAPI ++png_get_next_frame_delay_den(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_delay_den()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_delay_den); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_next_frame_dispose_op(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_dispose_op()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_dispose_op); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_next_frame_blend_op(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_blend_op()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_blend_op); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_first_frame_is_hidden()"); ++ ++ if (png_ptr != NULL) ++ return (png_byte)(png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN); ++ ++ PNG_UNUSED(info_ptr) ++ ++ return 0; ++} ++#endif /* PNG_APNG_SUPPORTED */ + #endif /* READ || WRITE */ +diff -Naru libpng-1.6.39.org/pnginfo.h libpng-1.6.39/pnginfo.h +--- libpng-1.6.39.org/pnginfo.h 2022-11-24 08:37:51.507052183 +0900 ++++ libpng-1.6.39/pnginfo.h 2022-11-24 08:41:17.785489740 +0900 +@@ -263,5 +263,18 @@ + png_bytepp row_pointers; /* the image bits */ + #endif + ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 num_frames; /* including default image */ ++ png_uint_32 num_plays; ++ png_uint_32 next_frame_width; ++ png_uint_32 next_frame_height; ++ png_uint_32 next_frame_x_offset; ++ png_uint_32 next_frame_y_offset; ++ png_uint_16 next_frame_delay_num; ++ png_uint_16 next_frame_delay_den; ++ png_byte next_frame_dispose_op; ++ png_byte next_frame_blend_op; ++#endif ++ + }; + #endif /* PNGINFO_H */ +diff -Naru libpng-1.6.39.org/pngpread.c libpng-1.6.39/pngpread.c +--- libpng-1.6.39.org/pngpread.c 2022-11-24 08:37:51.507052183 +0900 ++++ libpng-1.6.39/pngpread.c 2022-11-24 08:41:17.785489740 +0900 +@@ -195,6 +195,106 @@ + + chunk_name = png_ptr->chunk_name; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->num_frames_read > 0 && ++ png_ptr->num_frames_read < info_ptr->num_frames) ++ { ++ if (chunk_name == png_IDAT) ++ { ++ /* Discard trailing IDATs for the first frame */ ++ if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read > 1) ++ png_error(png_ptr, "out of place IDAT"); ++ ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ else if (chunk_name == png_fdAT) ++ { ++ if (png_ptr->buffer_size < 4) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_ensure_sequence_number(png_ptr, 4); ++ ++ if (!(png_ptr->mode & PNG_HAVE_fcTL)) ++ { ++ /* Discard trailing fdATs for frames other than the first */ ++ if (png_ptr->num_frames_read < 2) ++ png_error(png_ptr, "out of place fdAT"); ++ ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ ++ else ++ { ++ /* frame data follows */ ++ png_ptr->idat_size = png_ptr->push_length - 4; ++ png_ptr->mode |= PNG_HAVE_IDAT; ++ png_ptr->process_mode = PNG_READ_IDAT_MODE; ++ ++ return; ++ } ++ } ++ ++ else if (chunk_name == png_fcTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_read_reset(png_ptr); ++ png_ptr->mode &= ~PNG_HAVE_fcTL; ++ ++ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); ++ ++ if (!(png_ptr->mode & PNG_HAVE_fcTL)) ++ png_error(png_ptr, "missing required fcTL chunk"); ++ ++ png_read_reinit(png_ptr, info_ptr); ++ png_progressive_read_reset(png_ptr); ++ ++ if (png_ptr->frame_info_fn != NULL) ++ (*(png_ptr->frame_info_fn))(png_ptr, png_ptr->num_frames_read); ++ ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ ++ return; ++ } ++ ++ else ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ ++ return; ++ } ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + if (chunk_name == png_IDAT) + { + if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) +@@ -261,6 +361,9 @@ + + else if (chunk_name == png_IDAT) + { ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_have_info(png_ptr, info_ptr); ++#endif + png_ptr->idat_size = png_ptr->push_length; + png_ptr->process_mode = PNG_READ_IDAT_MODE; + png_push_have_info(png_ptr, info_ptr); +@@ -406,6 +509,30 @@ + png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); + } + #endif ++#ifdef PNG_READ_APNG_SUPPORTED ++ else if (chunk_name == png_acTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length); ++ } ++ ++ else if (chunk_name == png_fcTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); ++ } ++ ++#endif /* PNG_READ_APNG_SUPPORTED */ + + else + { +@@ -539,7 +666,11 @@ + png_byte chunk_tag[4]; + + /* TODO: this code can be commoned up with the same code in push_read */ ++#ifdef PNG_READ_APNG_SUPPORTED ++ PNG_PUSH_SAVE_BUFFER_IF_LT(12) ++#else + PNG_PUSH_SAVE_BUFFER_IF_LT(8) ++#endif + png_push_fill_buffer(png_ptr, chunk_length, 4); + png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); + png_reset_crc(png_ptr); +@@ -547,17 +678,64 @@ + png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); + png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->chunk_name != png_fdAT && png_ptr->num_frames_read > 0) ++ { ++ if (png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) ++ { ++ png_ptr->process_mode = PNG_READ_CHUNK_MODE; ++ if (png_ptr->frame_end_fn != NULL) ++ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); ++ png_ptr->num_frames_read++; ++ return; ++ } ++ else ++ { ++ if (png_ptr->chunk_name == png_IEND) ++ png_error(png_ptr, "Not enough image data"); ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ png_warning(png_ptr, "Skipping (ignoring) a chunk between " ++ "APNG chunks"); ++ png_crc_finish(png_ptr, png_ptr->push_length); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ } ++ else ++#endif ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->chunk_name != png_IDAT && png_ptr->num_frames_read == 0) ++#else + if (png_ptr->chunk_name != png_IDAT) ++#endif + { + png_ptr->process_mode = PNG_READ_CHUNK_MODE; + + if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) + png_error(png_ptr, "Not enough compressed data"); + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->frame_end_fn != NULL) ++ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); ++ png_ptr->num_frames_read++; ++#endif ++ + return; + } + + png_ptr->idat_size = png_ptr->push_length; ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->num_frames_read > 0) ++ { ++ png_ensure_sequence_number(png_ptr, 4); ++ png_ptr->idat_size -= 4; ++ } ++#endif + } + + if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0) +@@ -631,6 +809,15 @@ + if (!(buffer_length > 0) || buffer == NULL) + png_error(png_ptr, "No IDAT data (internal error)"); + ++#ifdef PNG_READ_APNG_SUPPORTED ++ /* If the app is not APNG-aware, decode only the first frame */ ++ if (!(png_ptr->apng_flags & PNG_APNG_APP) && png_ptr->num_frames_read > 0) ++ { ++ png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; ++ return; ++ } ++#endif ++ + /* This routine must process all the data it has been given + * before returning, calling the row callback as required to + * handle the uncompressed results. +@@ -1085,6 +1272,18 @@ + png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); + } + ++#ifdef PNG_READ_APNG_SUPPORTED ++void PNGAPI ++png_set_progressive_frame_fn(png_structp png_ptr, ++ png_progressive_frame_ptr frame_info_fn, ++ png_progressive_frame_ptr frame_end_fn) ++{ ++ png_ptr->frame_info_fn = frame_info_fn; ++ png_ptr->frame_end_fn = frame_end_fn; ++ png_ptr->apng_flags |= PNG_APNG_APP; ++} ++#endif ++ + png_voidp PNGAPI + png_get_progressive_ptr(png_const_structrp png_ptr) + { +diff -Naru libpng-1.6.39.org/pngpriv.h libpng-1.6.39/pngpriv.h +--- libpng-1.6.39.org/pngpriv.h 2022-11-24 08:37:51.508052181 +0900 ++++ libpng-1.6.39/pngpriv.h 2022-11-24 08:41:17.785489740 +0900 +@@ -628,6 +628,10 @@ + #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */ + /* 0x4000U (unused) */ + #define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */ ++#ifdef PNG_APNG_SUPPORTED ++#define PNG_HAVE_acTL 0x10000U ++#define PNG_HAVE_fcTL 0x20000U ++#endif + + /* Flags for the transformations the PNG library does on the image data */ + #define PNG_BGR 0x0001U +@@ -864,6 +868,16 @@ + #define png_tRNS PNG_U32(116, 82, 78, 83) + #define png_zTXt PNG_U32(122, 84, 88, 116) + ++#ifdef PNG_APNG_SUPPORTED ++#define png_acTL PNG_U32( 97, 99, 84, 76) ++#define png_fcTL PNG_U32(102, 99, 84, 76) ++#define png_fdAT PNG_U32(102, 100, 65, 84) ++ ++/* For png_struct.apng_flags: */ ++#define PNG_FIRST_FRAME_HIDDEN 0x0001U ++#define PNG_APNG_APP 0x0002U ++#endif ++ + /* The following will work on (signed char*) strings, whereas the get_uint_32 + * macro will fail on top-bit-set values because of the sign extension. + */ +@@ -1635,6 +1649,47 @@ + */ + #endif + ++#ifdef PNG_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_ensure_fcTL_is_valid,(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op), PNG_EMPTY); ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_handle_acTL,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_handle_fcTL,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_handle_fdAT,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_have_info,(png_structp png_ptr, png_infop info_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_ensure_sequence_number,(png_structp png_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_reset,(png_structp png_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_reinit,(png_structp png_ptr, ++ png_infop info_ptr),PNG_EMPTY); ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_progressive_read_reset,(png_structp png_ptr),PNG_EMPTY); ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_write_acTL,(png_structp png_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_fcTL,(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_fdAT,(png_structp png_ptr, ++ png_const_bytep data, png_size_t length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_reset,(png_structp png_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_reinit,(png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 width, png_uint_32 height),PNG_EMPTY); ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* Added at libpng version 1.4.0 */ + #ifdef PNG_COLORSPACE_SUPPORTED + /* These internal functions are for maintaining the colorspace structure within +diff -Naru libpng-1.6.39.org/pngread.c libpng-1.6.39/pngread.c +--- libpng-1.6.39.org/pngread.c 2022-11-24 08:37:51.508052181 +0900 ++++ libpng-1.6.39/pngread.c 2022-11-24 08:41:17.786489737 +0900 +@@ -161,6 +161,9 @@ + + else if (chunk_name == png_IDAT) + { ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_have_info(png_ptr, info_ptr); ++#endif + png_ptr->idat_size = length; + break; + } +@@ -255,6 +258,17 @@ + png_handle_iTXt(png_ptr, info_ptr, length); + #endif + ++#ifdef PNG_READ_APNG_SUPPORTED ++ else if (chunk_name == png_acTL) ++ png_handle_acTL(png_ptr, info_ptr, length); ++ ++ else if (chunk_name == png_fcTL) ++ png_handle_fcTL(png_ptr, info_ptr, length); ++ ++ else if (chunk_name == png_fdAT) ++ png_handle_fdAT(png_ptr, info_ptr, length); ++#endif ++ + else + png_handle_unknown(png_ptr, info_ptr, length, + PNG_HANDLE_CHUNK_AS_DEFAULT); +@@ -262,6 +276,72 @@ + } + #endif /* SEQUENTIAL_READ */ + ++#ifdef PNG_READ_APNG_SUPPORTED ++void PNGAPI ++png_read_frame_head(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_byte have_chunk_after_DAT; /* after IDAT or after fdAT */ ++ ++ png_debug(0, "Reading frame head"); ++ ++ if (!(png_ptr->mode & PNG_HAVE_acTL)) ++ png_error(png_ptr, "attempt to png_read_frame_head() but " ++ "no acTL present"); ++ ++ /* do nothing for the main IDAT */ ++ if (png_ptr->num_frames_read == 0) ++ return; ++ ++ png_read_reset(png_ptr); ++ png_ptr->flags &= ~PNG_FLAG_ROW_INIT; ++ png_ptr->mode &= ~PNG_HAVE_fcTL; ++ ++ have_chunk_after_DAT = 0; ++ for (;;) ++ { ++ png_uint_32 length = png_read_chunk_header(png_ptr); ++ ++ if (png_ptr->chunk_name == png_IDAT) ++ { ++ /* discard trailing IDATs for the first frame */ ++ if (have_chunk_after_DAT || png_ptr->num_frames_read > 1) ++ png_error(png_ptr, "png_read_frame_head(): out of place IDAT"); ++ png_crc_finish(png_ptr, length); ++ } ++ ++ else if (png_ptr->chunk_name == png_fcTL) ++ { ++ png_handle_fcTL(png_ptr, info_ptr, length); ++ have_chunk_after_DAT = 1; ++ } ++ ++ else if (png_ptr->chunk_name == png_fdAT) ++ { ++ png_ensure_sequence_number(png_ptr, length); ++ ++ /* discard trailing fdATs for frames other than the first */ ++ if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1) ++ png_crc_finish(png_ptr, length - 4); ++ else if(png_ptr->mode & PNG_HAVE_fcTL) ++ { ++ png_ptr->idat_size = length - 4; ++ png_ptr->mode |= PNG_HAVE_IDAT; ++ ++ break; ++ } ++ else ++ png_error(png_ptr, "png_read_frame_head(): out of place fdAT"); ++ } ++ else ++ { ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ png_crc_finish(png_ptr, length); ++ } ++ } ++} ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + /* Optional call to update the users info_ptr structure */ + void PNGAPI + png_read_update_info(png_structrp png_ptr, png_inforp info_ptr) +diff -Naru libpng-1.6.39.org/pngrutil.c libpng-1.6.39/pngrutil.c +--- libpng-1.6.39.org/pngrutil.c 2022-11-24 08:37:51.510052177 +0900 ++++ libpng-1.6.39/pngrutil.c 2022-11-24 08:41:17.787489734 +0900 +@@ -864,6 +864,11 @@ + filter_type = buf[11]; + interlace_type = buf[12]; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_ptr->first_frame_width = width; ++ png_ptr->first_frame_height = height; ++#endif ++ + /* Set internal variables */ + png_ptr->width = width; + png_ptr->height = height; +@@ -2858,6 +2863,179 @@ + } + #endif + ++#ifdef PNG_READ_APNG_SUPPORTED ++void /* PRIVATE */ ++png_handle_acTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_byte data[8]; ++ png_uint_32 num_frames; ++ png_uint_32 num_plays; ++ png_uint_32 didSet; ++ ++ png_debug(1, "in png_handle_acTL"); ++ ++ if (!(png_ptr->mode & PNG_HAVE_IHDR)) ++ { ++ png_error(png_ptr, "Missing IHDR before acTL"); ++ } ++ else if (png_ptr->mode & PNG_HAVE_IDAT) ++ { ++ png_warning(png_ptr, "Invalid acTL after IDAT skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ else if (png_ptr->mode & PNG_HAVE_acTL) ++ { ++ png_warning(png_ptr, "Duplicate acTL skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ else if (length != 8) ++ { ++ png_warning(png_ptr, "acTL with invalid length skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ ++ png_crc_read(png_ptr, data, 8); ++ png_crc_finish(png_ptr, 0); ++ ++ num_frames = png_get_uint_31(png_ptr, data); ++ num_plays = png_get_uint_31(png_ptr, data + 4); ++ ++ /* the set function will do error checking on num_frames */ ++ didSet = png_set_acTL(png_ptr, info_ptr, num_frames, num_plays); ++ if(didSet) ++ png_ptr->mode |= PNG_HAVE_acTL; ++} ++ ++void /* PRIVATE */ ++png_handle_fcTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_byte data[22]; ++ png_uint_32 width; ++ png_uint_32 height; ++ png_uint_32 x_offset; ++ png_uint_32 y_offset; ++ png_uint_16 delay_num; ++ png_uint_16 delay_den; ++ png_byte dispose_op; ++ png_byte blend_op; ++ ++ png_debug(1, "in png_handle_fcTL"); ++ ++ png_ensure_sequence_number(png_ptr, length); ++ ++ if (!(png_ptr->mode & PNG_HAVE_IHDR)) ++ { ++ png_error(png_ptr, "Missing IHDR before fcTL"); ++ } ++ else if (png_ptr->mode & PNG_HAVE_IDAT) ++ { ++ /* for any frames other then the first this message may be misleading, ++ * but correct. PNG_HAVE_IDAT is unset before the frame head is read ++ * i can't think of a better message */ ++ png_warning(png_ptr, "Invalid fcTL after IDAT skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ else if (png_ptr->mode & PNG_HAVE_fcTL) ++ { ++ png_warning(png_ptr, "Duplicate fcTL within one frame skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ else if (length != 26) ++ { ++ png_warning(png_ptr, "fcTL with invalid length skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ ++ png_crc_read(png_ptr, data, 22); ++ png_crc_finish(png_ptr, 0); ++ ++ width = png_get_uint_31(png_ptr, data); ++ height = png_get_uint_31(png_ptr, data + 4); ++ x_offset = png_get_uint_31(png_ptr, data + 8); ++ y_offset = png_get_uint_31(png_ptr, data + 12); ++ delay_num = png_get_uint_16(data + 16); ++ delay_den = png_get_uint_16(data + 18); ++ dispose_op = data[20]; ++ blend_op = data[21]; ++ ++ if (png_ptr->num_frames_read == 0 && (x_offset != 0 || y_offset != 0)) ++ { ++ png_warning(png_ptr, "fcTL for the first frame must have zero offset"); ++ return; ++ } ++ ++ if (info_ptr != NULL) ++ { ++ if (png_ptr->num_frames_read == 0 && ++ (width != info_ptr->width || height != info_ptr->height)) ++ { ++ png_warning(png_ptr, "size in first frame's fcTL must match " ++ "the size in IHDR"); ++ return; ++ } ++ ++ /* The set function will do more error checking */ ++ png_set_next_frame_fcTL(png_ptr, info_ptr, width, height, ++ x_offset, y_offset, delay_num, delay_den, ++ dispose_op, blend_op); ++ ++ png_read_reinit(png_ptr, info_ptr); ++ ++ png_ptr->mode |= PNG_HAVE_fcTL; ++ } ++} ++ ++void /* PRIVATE */ ++png_have_info(png_structp png_ptr, png_infop info_ptr) ++{ ++ if((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid & PNG_INFO_fcTL)) ++ { ++ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; ++ info_ptr->num_frames++; ++ } ++} ++ ++void /* PRIVATE */ ++png_handle_fdAT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_ensure_sequence_number(png_ptr, length); ++ ++ /* This function is only called from png_read_end(), png_read_info(), ++ * and png_push_read_chunk() which means that: ++ * - the user doesn't want to read this frame ++ * - or this is an out-of-place fdAT ++ * in either case it is safe to ignore the chunk with a warning */ ++ png_warning(png_ptr, "ignoring fdAT chunk"); ++ png_crc_finish(png_ptr, length - 4); ++ PNG_UNUSED(info_ptr) ++} ++ ++void /* PRIVATE */ ++png_ensure_sequence_number(png_structp png_ptr, png_uint_32 length) ++{ ++ png_byte data[4]; ++ png_uint_32 sequence_number; ++ ++ if (length < 4) ++ png_error(png_ptr, "invalid fcTL or fdAT chunk found"); ++ ++ png_crc_read(png_ptr, data, 4); ++ sequence_number = png_get_uint_31(png_ptr, data); ++ ++ if (sequence_number != png_ptr->next_seq_num) ++ png_error(png_ptr, "fcTL or fdAT chunk with out-of-order sequence " ++ "number found"); ++ ++ png_ptr->next_seq_num++; ++} ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED + /* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */ + static int +@@ -4166,7 +4344,38 @@ + { + uInt avail_in; + png_bytep buffer; ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_uint_32 bytes_to_skip = 0; ++ ++ while (png_ptr->idat_size == 0 || bytes_to_skip != 0) ++ { ++ png_crc_finish(png_ptr, bytes_to_skip); ++ bytes_to_skip = 0; + ++ png_ptr->idat_size = png_read_chunk_header(png_ptr); ++ if (png_ptr->num_frames_read == 0) ++ { ++ if (png_ptr->chunk_name != png_IDAT) ++ png_error(png_ptr, "Not enough image data"); ++ } ++ else ++ { ++ if (png_ptr->chunk_name == png_IEND) ++ png_error(png_ptr, "Not enough image data"); ++ if (png_ptr->chunk_name != png_fdAT) ++ { ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ bytes_to_skip = png_ptr->idat_size; ++ continue; ++ } ++ ++ png_ensure_sequence_number(png_ptr, png_ptr->idat_size); ++ ++ png_ptr->idat_size -= 4; ++ } ++ } ++#else + while (png_ptr->idat_size == 0) + { + png_crc_finish(png_ptr, 0); +@@ -4178,7 +4387,7 @@ + if (png_ptr->chunk_name != png_IDAT) + png_error(png_ptr, "Not enough image data"); + } +- ++#endif /* PNG_READ_APNG_SUPPORTED */ + avail_in = png_ptr->IDAT_read_size; + + if (avail_in > png_ptr->idat_size) +@@ -4241,6 +4450,9 @@ + + png_ptr->mode |= PNG_AFTER_IDAT; + png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_ptr->num_frames_read++; ++#endif + + if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0) + png_chunk_benign_error(png_ptr, "Extra compressed data"); +@@ -4678,4 +4890,80 @@ + + png_ptr->flags |= PNG_FLAG_ROW_INIT; + } ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++/* This function is to be called after the main IDAT set has been read and ++ * before a new IDAT is read. It resets some parts of png_ptr ++ * to make them usable by the read functions again */ ++void /* PRIVATE */ ++png_read_reset(png_structp png_ptr) ++{ ++ png_ptr->mode &= ~PNG_HAVE_IDAT; ++ png_ptr->mode &= ~PNG_AFTER_IDAT; ++ png_ptr->row_number = 0; ++ png_ptr->pass = 0; ++} ++ ++void /* PRIVATE */ ++png_read_reinit(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_ptr->width = info_ptr->next_frame_width; ++ png_ptr->height = info_ptr->next_frame_height; ++ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); ++ png_ptr->info_rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, ++ png_ptr->width); ++ if (png_ptr->prev_row) ++ memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); ++} ++ ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++/* same as png_read_reset() but for the progressive reader */ ++void /* PRIVATE */ ++png_progressive_read_reset(png_structp png_ptr) ++{ ++#ifdef PNG_READ_INTERLACING_SUPPORTED ++ /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ ++ ++ /* Start of interlace block */ ++ const int png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; ++ ++ /* Offset to next interlace block */ ++ const int png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; ++ ++ /* Start of interlace block in the y direction */ ++ const int png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; ++ ++ /* Offset to next interlace block in the y direction */ ++ const int png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; ++ ++ if (png_ptr->interlaced) ++ { ++ if (!(png_ptr->transformations & PNG_INTERLACE)) ++ png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - ++ png_pass_ystart[0]) / png_pass_yinc[0]; ++ else ++ png_ptr->num_rows = png_ptr->height; ++ ++ png_ptr->iwidth = (png_ptr->width + ++ png_pass_inc[png_ptr->pass] - 1 - ++ png_pass_start[png_ptr->pass]) / ++ png_pass_inc[png_ptr->pass]; ++ } ++ else ++#endif /* PNG_READ_INTERLACING_SUPPORTED */ ++ { ++ png_ptr->num_rows = png_ptr->height; ++ png_ptr->iwidth = png_ptr->width; ++ } ++ png_ptr->flags &= ~PNG_FLAG_ZSTREAM_ENDED; ++ if (inflateReset(&(png_ptr->zstream)) != Z_OK) ++ png_error(png_ptr, "inflateReset failed"); ++ png_ptr->zstream.avail_in = 0; ++ png_ptr->zstream.next_in = 0; ++ png_ptr->zstream.next_out = png_ptr->row_buf; ++ png_ptr->zstream.avail_out = (uInt)PNG_ROWBYTES(png_ptr->pixel_depth, ++ png_ptr->iwidth) + 1; ++} ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ + #endif /* READ */ +diff -Naru libpng-1.6.39.org/pngset.c libpng-1.6.39/pngset.c +--- libpng-1.6.39.org/pngset.c 2022-11-24 08:37:51.510052177 +0900 ++++ libpng-1.6.39/pngset.c 2022-11-24 08:41:17.787489734 +0900 +@@ -288,6 +288,11 @@ + info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); + + info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); ++ ++#ifdef PNG_APNG_SUPPORTED ++ /* for non-animated png. this may be overwritten from an acTL chunk later */ ++ info_ptr->num_frames = 1; ++#endif + } + + #ifdef PNG_oFFs_SUPPORTED +@@ -1161,6 +1166,147 @@ + } + #endif /* sPLT */ + ++#ifdef PNG_APNG_SUPPORTED ++png_uint_32 PNGAPI ++png_set_acTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays) ++{ ++ png_debug1(1, "in %s storage function", "acTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_acTL() with NULL png_ptr " ++ "or info_ptr ignored"); ++ return (0); ++ } ++ if (num_frames == 0) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames zero"); ++ return (0); ++ } ++ if (num_frames > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames > 2^31-1"); ++ return (0); ++ } ++ if (num_plays > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_plays " ++ "> 2^31-1"); ++ return (0); ++ } ++ ++ info_ptr->num_frames = num_frames; ++ info_ptr->num_plays = num_plays; ++ ++ info_ptr->valid |= PNG_INFO_acTL; ++ ++ return (1); ++} ++ ++/* delay_num and delay_den can hold any 16-bit values including zero */ ++png_uint_32 PNGAPI ++png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ png_debug1(1, "in %s storage function", "fcTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " ++ "ignored"); ++ return (0); ++ } ++ ++ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ if (blend_op == PNG_BLEND_OP_OVER) ++ { ++ if (!(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) && ++ !(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) ++ { ++ png_warning(png_ptr, "PNG_BLEND_OP_OVER is meaningless " ++ "and wasteful for opaque images, ignored"); ++ blend_op = PNG_BLEND_OP_SOURCE; ++ } ++ } ++ ++ info_ptr->next_frame_width = width; ++ info_ptr->next_frame_height = height; ++ info_ptr->next_frame_x_offset = x_offset; ++ info_ptr->next_frame_y_offset = y_offset; ++ info_ptr->next_frame_delay_num = delay_num; ++ info_ptr->next_frame_delay_den = delay_den; ++ info_ptr->next_frame_dispose_op = dispose_op; ++ info_ptr->next_frame_blend_op = blend_op; ++ ++ info_ptr->valid |= PNG_INFO_fcTL; ++ ++ return (1); ++} ++ ++void /* PRIVATE */ ++png_ensure_fcTL_is_valid(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ if (width == 0 || width > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); ++ if (height == 0 || height > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); ++ if (x_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); ++ if (y_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); ++ if (width + x_offset > png_ptr->first_frame_width || ++ height + y_offset > png_ptr->first_frame_height) ++ png_error(png_ptr, "dimensions of a frame are greater than" ++ "the ones in IHDR"); ++ ++ if (dispose_op != PNG_DISPOSE_OP_NONE && ++ dispose_op != PNG_DISPOSE_OP_BACKGROUND && ++ dispose_op != PNG_DISPOSE_OP_PREVIOUS) ++ png_error(png_ptr, "invalid dispose_op in fcTL"); ++ ++ if (blend_op != PNG_BLEND_OP_SOURCE && ++ blend_op != PNG_BLEND_OP_OVER) ++ png_error(png_ptr, "invalid blend_op in fcTL"); ++ ++ PNG_UNUSED(delay_num) ++ PNG_UNUSED(delay_den) ++} ++ ++png_uint_32 PNGAPI ++png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, ++ png_byte is_hidden) ++{ ++ png_debug(1, "in png_first_frame_is_hidden()"); ++ ++ if (png_ptr == NULL) ++ return 0; ++ ++ if (is_hidden) ++ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; ++ else ++ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; ++ ++ PNG_UNUSED(info_ptr) ++ ++ return 1; ++} ++#endif /* PNG_APNG_SUPPORTED */ ++ + #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED + static png_byte + check_location(png_const_structrp png_ptr, int location) +diff -Naru libpng-1.6.39.org/pngstruct.h libpng-1.6.39/pngstruct.h +--- libpng-1.6.39.org/pngstruct.h 2022-11-24 08:37:51.510052177 +0900 ++++ libpng-1.6.39/pngstruct.h 2022-11-24 08:41:17.787489734 +0900 +@@ -399,6 +399,27 @@ + png_byte filter_type; + #endif + ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 apng_flags; ++ png_uint_32 next_seq_num; /* next fcTL/fdAT chunk sequence number */ ++ png_uint_32 first_frame_width; ++ png_uint_32 first_frame_height; ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_uint_32 num_frames_read; /* incremented after all image data of */ ++ /* a frame is read */ ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++ png_progressive_frame_ptr frame_info_fn; /* frame info read callback */ ++ png_progressive_frame_ptr frame_end_fn; /* frame data read callback */ ++#endif ++#endif ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_uint_32 num_frames_to_write; ++ png_uint_32 num_frames_written; ++#endif ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* New members added in libpng-1.2.0 */ + + /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +diff -Naru libpng-1.6.39.org/pngtest.c libpng-1.6.39/pngtest.c +--- libpng-1.6.39.org/pngtest.c 2022-11-24 08:37:51.510052177 +0900 ++++ libpng-1.6.39/pngtest.c 2022-11-24 08:41:17.787489734 +0900 +@@ -875,6 +875,10 @@ + volatile int num_passes; + int pass; + int bit_depth, color_type; ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 num_frames; ++ png_uint_32 num_plays; ++#endif + + row_buf = NULL; + error_parameters.file_name = inname; +@@ -1383,6 +1387,22 @@ + } + } + #endif ++ ++#ifdef PNG_APNG_SUPPORTED ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) ++ { ++ if (png_get_acTL(read_ptr, read_info_ptr, &num_frames, &num_plays)) ++ { ++ png_byte is_hidden; ++ pngtest_debug2("Handling acTL chunks (frames %ld, plays %ld)", ++ num_frames, num_plays); ++ png_set_acTL(write_ptr, write_info_ptr, num_frames, num_plays); ++ is_hidden = png_get_first_frame_is_hidden(read_ptr, read_info_ptr); ++ png_set_first_frame_is_hidden(write_ptr, write_info_ptr, is_hidden); ++ } ++ } ++#endif ++ + #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + { + png_unknown_chunkp unknowns; +@@ -1463,6 +1483,110 @@ + t_misc += (t_stop - t_start); + t_start = t_stop; + #endif ++#ifdef PNG_APNG_SUPPORTED ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) ++ { ++ png_uint_32 frame; ++ for (frame = 0; frame < num_frames; frame++) ++ { ++ png_uint_32 frame_width; ++ png_uint_32 frame_height; ++ png_uint_32 x_offset; ++ png_uint_32 y_offset; ++ png_uint_16 delay_num; ++ png_uint_16 delay_den; ++ png_byte dispose_op; ++ png_byte blend_op; ++ png_read_frame_head(read_ptr, read_info_ptr); ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_fcTL)) ++ { ++ png_get_next_frame_fcTL(read_ptr, read_info_ptr, ++ &frame_width, &frame_height, ++ &x_offset, &y_offset, ++ &delay_num, &delay_den, ++ &dispose_op, &blend_op); ++ } ++ else ++ { ++ frame_width = width; ++ frame_height = height; ++ x_offset = 0; ++ y_offset = 0; ++ delay_num = 1; ++ delay_den = 1; ++ dispose_op = PNG_DISPOSE_OP_NONE; ++ blend_op = PNG_BLEND_OP_SOURCE; ++ } ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_write_frame_head(write_ptr, write_info_ptr, (png_bytepp)&row_buf, ++ frame_width, frame_height, ++ x_offset, y_offset, ++ delay_num, delay_den, ++ dispose_op, blend_op); ++#endif ++ for (pass = 0; pass < num_passes; pass++) ++ { ++# ifdef calc_pass_height ++ png_uint_32 pass_height; ++ ++ if (num_passes == 7) /* interlaced */ ++ { ++ if (PNG_PASS_COLS(frame_width, pass) > 0) ++ pass_height = PNG_PASS_ROWS(frame_height, pass); ++ ++ else ++ pass_height = 0; ++ } ++ ++ else /* not interlaced */ ++ pass_height = frame_height; ++# else ++# define pass_height frame_height ++# endif ++ ++ pngtest_debug1("Writing row data for pass %d", pass); ++ for (y = 0; y < pass_height; y++) ++ { ++#ifndef SINGLE_ROWBUF_ALLOC ++ pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", pass, y); ++ ++ row_buf = (png_bytep)png_malloc(read_ptr, ++ png_get_rowbytes(read_ptr, read_info_ptr)); ++ ++ pngtest_debug2("\t0x%08lx (%lu bytes)", (unsigned long)row_buf, ++ (unsigned long)png_get_rowbytes(read_ptr, read_info_ptr)); ++ ++#endif /* !SINGLE_ROWBUF_ALLOC */ ++ png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1); ++ ++#ifdef PNG_WRITE_SUPPORTED ++#ifdef PNGTEST_TIMING ++ t_stop = (float)clock(); ++ t_decode += (t_stop - t_start); ++ t_start = t_stop; ++#endif ++ png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); ++#ifdef PNGTEST_TIMING ++ t_stop = (float)clock(); ++ t_encode += (t_stop - t_start); ++ t_start = t_stop; ++#endif ++#endif /* PNG_WRITE_SUPPORTED */ ++ ++#ifndef SINGLE_ROWBUF_ALLOC ++ pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y); ++ png_free(read_ptr, row_buf); ++ row_buf = NULL; ++#endif /* !SINGLE_ROWBUF_ALLOC */ ++ } ++ } ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_write_frame_tail(write_ptr, write_info_ptr); ++#endif ++ } ++ } ++ else ++#endif + for (pass = 0; pass < num_passes; pass++) + { + # ifdef calc_pass_height +diff -Naru libpng-1.6.39.org/pngwrite.c libpng-1.6.39/pngwrite.c +--- libpng-1.6.39.org/pngwrite.c 2022-11-24 08:37:51.511052176 +0900 ++++ libpng-1.6.39/pngwrite.c 2022-11-24 08:41:17.787489734 +0900 +@@ -128,6 +128,10 @@ + * the application continues writing the PNG. So check the 'invalid' + * flag here too. + */ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ if (info_ptr->valid & PNG_INFO_acTL) ++ png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); ++#endif + #ifdef PNG_GAMMA_SUPPORTED + # ifdef PNG_WRITE_gAMA_SUPPORTED + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && +@@ -370,6 +374,11 @@ + png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ if (png_ptr->num_frames_written != png_ptr->num_frames_to_write) ++ png_error(png_ptr, "Not enough frames written"); ++#endif ++ + /* See if user wants us to write information chunks */ + if (info_ptr != NULL) + { +@@ -1471,6 +1480,43 @@ + } + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void PNGAPI ++png_write_frame_head(png_structp png_ptr, png_infop info_ptr, ++ png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op) ++{ ++ png_debug(1, "in png_write_frame_head"); ++ ++ /* there is a chance this has been set after png_write_info was called, ++ * so it would be set but not written. is there a way to be sure? */ ++ if (!(info_ptr->valid & PNG_INFO_acTL)) ++ png_error(png_ptr, "png_write_frame_head(): acTL not set"); ++ ++ png_write_reset(png_ptr); ++ ++ png_write_reinit(png_ptr, info_ptr, width, height); ++ ++ if ( !(png_ptr->num_frames_written == 0 && ++ (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ) ) ++ png_write_fcTL(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ PNG_UNUSED(row_pointers) ++} ++ ++void PNGAPI ++png_write_frame_tail(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_write_frame_tail"); ++ ++ png_ptr->num_frames_written++; ++ ++ PNG_UNUSED(info_ptr) ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + + #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED + /* Initialize the write structure - general purpose utility. */ +diff -Naru libpng-1.6.39.org/pngwutil.c libpng-1.6.39/pngwutil.c +--- libpng-1.6.39.org/pngwutil.c 2022-11-24 08:37:51.511052176 +0900 ++++ libpng-1.6.39/pngwutil.c 2022-11-24 08:41:17.788489731 +0900 +@@ -821,6 +821,11 @@ + /* Write the chunk */ + png_write_complete_chunk(png_ptr, png_IHDR, buf, 13); + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_ptr->first_frame_width = width; ++ png_ptr->first_frame_height = height; ++#endif ++ + if ((png_ptr->do_filter) == PNG_NO_FILTERS) + { + if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || +@@ -1002,8 +1007,17 @@ + optimize_cmf(data, png_image_size(png_ptr)); + #endif + +- if (size > 0) +- png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++ if (size > 0) ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ { ++ if (png_ptr->num_frames_written == 0) ++#endif ++ png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ else ++ png_write_fdAT(png_ptr, data, size); ++ } ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + png_ptr->mode |= PNG_HAVE_IDAT; + + png_ptr->zstream.next_out = data; +@@ -1050,7 +1064,17 @@ + #endif + + if (size > 0) ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ { ++ if (png_ptr->num_frames_written == 0) ++#endif + png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ else ++ png_write_fdAT(png_ptr, data, size); ++ } ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++ + png_ptr->zstream.avail_out = 0; + png_ptr->zstream.next_out = NULL; + png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; +@@ -1885,6 +1909,82 @@ + } + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void /* PRIVATE */ ++png_write_acTL(png_structp png_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays) ++{ ++ png_byte buf[8]; ++ ++ png_debug(1, "in png_write_acTL"); ++ ++ png_ptr->num_frames_to_write = num_frames; ++ ++ if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ++ num_frames--; ++ ++ png_save_uint_32(buf, num_frames); ++ png_save_uint_32(buf + 4, num_plays); ++ ++ png_write_complete_chunk(png_ptr, png_acTL, buf, (png_size_t)8); ++} ++ ++void /* PRIVATE */ ++png_write_fcTL(png_structp png_ptr, png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op) ++{ ++ png_byte buf[26]; ++ ++ png_debug(1, "in png_write_fcTL"); ++ ++ if (png_ptr->num_frames_written == 0 && (x_offset != 0 || y_offset != 0)) ++ png_error(png_ptr, "x and/or y offset for the first frame aren't 0"); ++ if (png_ptr->num_frames_written == 0 && ++ (width != png_ptr->first_frame_width || ++ height != png_ptr->first_frame_height)) ++ png_error(png_ptr, "width and/or height in the first frame's fcTL " ++ "don't match the ones in IHDR"); ++ ++ /* more error checking */ ++ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ png_save_uint_32(buf, png_ptr->next_seq_num); ++ png_save_uint_32(buf + 4, width); ++ png_save_uint_32(buf + 8, height); ++ png_save_uint_32(buf + 12, x_offset); ++ png_save_uint_32(buf + 16, y_offset); ++ png_save_uint_16(buf + 20, delay_num); ++ png_save_uint_16(buf + 22, delay_den); ++ buf[24] = dispose_op; ++ buf[25] = blend_op; ++ ++ png_write_complete_chunk(png_ptr, png_fcTL, buf, (png_size_t)26); ++ ++ png_ptr->next_seq_num++; ++} ++ ++void /* PRIVATE */ ++png_write_fdAT(png_structp png_ptr, ++ png_const_bytep data, png_size_t length) ++{ ++ png_byte buf[4]; ++ ++ png_write_chunk_header(png_ptr, png_fdAT, (png_uint_32)(4 + length)); ++ ++ png_save_uint_32(buf, png_ptr->next_seq_num); ++ png_write_chunk_data(png_ptr, buf, 4); ++ ++ png_write_chunk_data(png_ptr, data, length); ++ ++ png_write_chunk_end(png_ptr); ++ ++ png_ptr->next_seq_num++; ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++ + /* Initializes the row writing capability of libpng */ + void /* PRIVATE */ + png_write_start_row(png_structrp png_ptr) +@@ -2778,4 +2878,39 @@ + } + #endif /* WRITE_FLUSH */ + } ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void /* PRIVATE */ ++png_write_reset(png_structp png_ptr) ++{ ++ png_ptr->row_number = 0; ++ png_ptr->pass = 0; ++ png_ptr->mode &= ~PNG_HAVE_IDAT; ++} ++ ++void /* PRIVATE */ ++png_write_reinit(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 width, png_uint_32 height) ++{ ++ if (png_ptr->num_frames_written == 0 && ++ (width != png_ptr->first_frame_width || ++ height != png_ptr->first_frame_height)) ++ png_error(png_ptr, "width and/or height in the first frame's fcTL " ++ "don't match the ones in IHDR"); ++ if (width > png_ptr->first_frame_width || ++ height > png_ptr->first_frame_height) ++ png_error(png_ptr, "width and/or height for a frame greater than" ++ "the ones in IHDR"); ++ ++ png_set_IHDR(png_ptr, info_ptr, width, height, ++ info_ptr->bit_depth, info_ptr->color_type, ++ info_ptr->interlace_type, info_ptr->compression_type, ++ info_ptr->filter_type); ++ ++ png_ptr->width = width; ++ png_ptr->height = height; ++ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); ++ png_ptr->usr_width = png_ptr->width; ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + #endif /* WRITE */ +diff -Naru libpng-1.6.39.org/scripts/symbols.def libpng-1.6.39/scripts/symbols.def +--- libpng-1.6.39.org/scripts/symbols.def 2022-11-24 08:37:51.515052168 +0900 ++++ libpng-1.6.39/scripts/symbols.def 2022-11-24 08:41:17.788489731 +0900 +@@ -253,3 +253,23 @@ + png_set_eXIf @247 + png_get_eXIf_1 @248 + png_set_eXIf_1 @249 ++ png_get_acTL @250 ++ png_set_acTL @251 ++ png_get_num_frames @252 ++ png_get_num_plays @253 ++ png_get_next_frame_fcTL @254 ++ png_set_next_frame_fcTL @255 ++ png_get_next_frame_width @256 ++ png_get_next_frame_height @257 ++ png_get_next_frame_x_offset @258 ++ png_get_next_frame_y_offset @259 ++ png_get_next_frame_delay_num @260 ++ png_get_next_frame_delay_den @261 ++ png_get_next_frame_dispose_op @262 ++ png_get_next_frame_blend_op @263 ++ png_get_first_frame_is_hidden @264 ++ png_set_first_frame_is_hidden @265 ++ png_read_frame_head @266 ++ png_set_progressive_frame_fn @267 ++ png_write_frame_head @268 ++ png_write_frame_tail @269 diff --git a/tests/meson.build b/tests/meson.build index f7490664..b55669c6 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -27,8 +27,14 @@ write_fuzzer_exe = executable('fuzz_write_repro', png_dep = dependency('libpng', version : '>=1.6.0', fallback : ['libpng', 'png_dep']) -if not cc.has_function('png_get_acTL', prefix : '#include ', dependencies : png_dep) - error('Tests require libpng with Animated PNG (APNG) support') +if png_dep.type_name() != 'internal' # compiler.has_function() does not work with wraps + if not cc.has_function('png_get_acTL', prefix : '#include ', dependencies : png_dep) + error('Tests require libpng with Animated PNG (APNG) support, see build documentation') + endif +else + if meson.version().version_compare('< 0.63.0') # Older versions cannot apply the APNG patch + warning('Meson version is too old to use libpng fallback') + endif endif test_deps = [ spng_dep, png_dep ] From e918e625c560caec403dab936e241800a9bcb408 Mon Sep 17 00:00:00 2001 From: Randy Date: Thu, 1 Jun 2023 22:31:54 +0300 Subject: [PATCH 4/9] meson: try libpng fallback if APNG is not supported --- tests/meson.build | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index b55669c6..9ae17472 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -27,13 +27,25 @@ write_fuzzer_exe = executable('fuzz_write_repro', png_dep = dependency('libpng', version : '>=1.6.0', fallback : ['libpng', 'png_dep']) +can_apply_patch = meson.version().version_compare('< 0.63.0') # Older versions cannot apply the APNG patch +apng_note = 'Tests require libpng with Animated PNG (APNG) support, see build documentation' +meson_too_old_msg = 'Meson version is too old to use libpng fallback' + if png_dep.type_name() != 'internal' # compiler.has_function() does not work with wraps if not cc.has_function('png_get_acTL', prefix : '#include ', dependencies : png_dep) - error('Tests require libpng with Animated PNG (APNG) support, see build documentation') + + warning(apng_note) + + if can_apply_patch == false + error(meson_too_old_msg) + else + warning('Local version of libpng does not support APNG, attempting to use fallback option...') + png_dep = subproject('libpng') # May fail depending on wrap_mode, hence the warning above + endif endif -else - if meson.version().version_compare('< 0.63.0') # Older versions cannot apply the APNG patch - warning('Meson version is too old to use libpng fallback') +else # Using fallback + if can_apply_patch == false + warning(meson_too_old_msg) endif endif From 84dc0250256a925a7ec7989b0be1a000fd2b92a5 Mon Sep 17 00:00:00 2001 From: Randy Date: Thu, 1 Jun 2023 23:24:34 +0300 Subject: [PATCH 5/9] meson: fix version check --- tests/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/meson.build b/tests/meson.build index 9ae17472..3077935c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -27,7 +27,7 @@ write_fuzzer_exe = executable('fuzz_write_repro', png_dep = dependency('libpng', version : '>=1.6.0', fallback : ['libpng', 'png_dep']) -can_apply_patch = meson.version().version_compare('< 0.63.0') # Older versions cannot apply the APNG patch +can_apply_patch = meson.version().version_compare('>= 0.63.0') # Older versions cannot apply the APNG patch apng_note = 'Tests require libpng with Animated PNG (APNG) support, see build documentation' meson_too_old_msg = 'Meson version is too old to use libpng fallback' From ffc12261a07dc9711f818caa59033fbbf2b05224 Mon Sep 17 00:00:00 2001 From: Randy Date: Thu, 1 Jun 2023 23:31:22 +0300 Subject: [PATCH 6/9] meson: fix subproject fallback for libpng --- tests/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/meson.build b/tests/meson.build index 3077935c..069c1ea3 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -40,7 +40,7 @@ if png_dep.type_name() != 'internal' # compiler.has_function() does not work wit error(meson_too_old_msg) else warning('Local version of libpng does not support APNG, attempting to use fallback option...') - png_dep = subproject('libpng') # May fail depending on wrap_mode, hence the warning above + png_dep = subproject('libpng').get_variable('png_dep') # May fail depending on wrap_mode, hence the warning above endif endif else # Using fallback From d4df3bb68fbdc2fe1034706b631c39bc290a6850 Mon Sep 17 00:00:00 2001 From: Randy Date: Mon, 12 Jun 2023 19:02:11 +0300 Subject: [PATCH 7/9] docs: tests now require apng support in libpng [skip-ci] --- docs/build.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/build.md b/docs/build.md index 2fecbcb3..a7d68d3a 100644 --- a/docs/build.md +++ b/docs/build.md @@ -30,6 +30,22 @@ ninja ninja install ``` +## Testing + +Tests require [libpng](http://libpng.org/pub/png/libpng.html) with Animated PNG (APNG) support, +as of v1.6.39 the APNG feature is an out-of-tree patch. +Some platforms (e.g. Debian) ship `libpng` with APNG support, for other platforms a fallback option is provided. +The fallback option requires Meson 0.63.0 or newer and involves downloading libpng source code and the corresponding Meson build file, the APNG patch included under `subprojects/packagefiles/apng` is applied automatically. +The fallback option is used by default if `libpng` does not include APNG support or can't be found on the system. + +The vast majority of tests require `libpng` and is enabled through the `dev_build` option: + +```bash +meson build -Ddev_build=true +cd build +meson test +``` + ## Embedding the source code The source files `spng.c`/`spng.h` can be embedded in a project without From 5ca03a02d449c35484c16007c56122353da6f192 Mon Sep 17 00:00:00 2001 From: Randy Date: Mon, 19 Jun 2023 13:05:02 +0300 Subject: [PATCH 8/9] docs: add 'setup' command for meson builds [skip-ci] --- docs/build.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build.md b/docs/build.md index a7d68d3a..58cd4df4 100644 --- a/docs/build.md +++ b/docs/build.md @@ -24,7 +24,7 @@ make install ## Meson ```bash -meson build --buildtype=release # Default is debug +meson setup build --buildtype=release # Default is debug cd build ninja ninja install @@ -41,7 +41,7 @@ The fallback option is used by default if `libpng` does not include APNG support The vast majority of tests require `libpng` and is enabled through the `dev_build` option: ```bash -meson build -Ddev_build=true +meson setup build -Ddev_build=true cd build meson test ``` From 38509f4ca3818ad1b4b3cde770cf3fb0df580cbf Mon Sep 17 00:00:00 2001 From: Randy Date: Tue, 12 Sep 2023 20:24:08 +0300 Subject: [PATCH 9/9] add test images --- tests/apng_images/000.png | Bin 0 -> 249 bytes tests/apng_images/001.png | Bin 0 -> 307 bytes tests/apng_images/002.png | Bin 0 -> 470 bytes tests/apng_images/003.png | Bin 0 -> 261 bytes tests/apng_images/004.png | Bin 0 -> 273 bytes tests/apng_images/005.png | Bin 0 -> 486 bytes tests/apng_images/006.png | Bin 0 -> 502 bytes tests/apng_images/007.png | Bin 0 -> 617 bytes tests/apng_images/008.png | Bin 0 -> 572 bytes tests/apng_images/009.png | Bin 0 -> 508 bytes tests/apng_images/010.png | Bin 0 -> 780 bytes tests/apng_images/011.png | Bin 0 -> 508 bytes tests/apng_images/012.png | Bin 0 -> 371 bytes tests/apng_images/013.png | Bin 0 -> 613 bytes tests/apng_images/014.png | Bin 0 -> 327 bytes tests/apng_images/015.png | Bin 0 -> 492 bytes tests/apng_images/016.png | Bin 0 -> 677 bytes tests/apng_images/017.png | Bin 0 -> 671 bytes tests/apng_images/018.png | Bin 0 -> 534 bytes tests/apng_images/019.png | Bin 0 -> 614 bytes tests/apng_images/020.png | Bin 0 -> 579 bytes tests/apng_images/021.png | Bin 0 -> 28791 bytes tests/apng_images/022.png | Bin 0 -> 3336 bytes tests/apng_images/023.png | Bin 0 -> 3486 bytes tests/apng_images/024.png | Bin 0 -> 508 bytes tests/apng_images/025.png | Bin 0 -> 1068 bytes tests/apng_images/026.png | Bin 0 -> 646 bytes tests/apng_images/027.png | Bin 0 -> 646 bytes tests/apng_images/028.png | Bin 0 -> 646 bytes tests/apng_images/029.png | Bin 0 -> 1067 bytes tests/apng_images/030.png | Bin 0 -> 646 bytes tests/apng_images/031.png | Bin 0 -> 646 bytes tests/apng_images/032.png | Bin 0 -> 646 bytes tests/apng_images/033.png | Bin 0 -> 915 bytes tests/apng_images/034.png | Bin 0 -> 331 bytes tests/apng_images/035.png | Bin 0 -> 668 bytes tests/apng_images/036.png | Bin 0 -> 262 bytes tests/apng_images/037.png | Bin 0 -> 308 bytes tests/apng_images/038.png | Bin 0 -> 276 bytes tests/apng_images/039.png | Bin 0 -> 450 bytes tests/apng_images/040.png | Bin 0 -> 490 bytes tests/apng_images/041.png | Bin 0 -> 470 bytes tests/apng_images/042.png | Bin 0 -> 432 bytes tests/apng_images/043.png | Bin 0 -> 508 bytes tests/apng_images/044.png | Bin 0 -> 508 bytes tests/apng_images/045.png | Bin 0 -> 65 bytes tests/apng_images/046.png | Bin 0 -> 269 bytes tests/apng_images/047.png | Bin 0 -> 671 bytes tests/apng_images/048.png | Bin 0 -> 671 bytes tests/apng_images/049.png | Bin 0 -> 671 bytes tests/apng_images/050.png | Bin 0 -> 470 bytes tests/apng_images/051.png | Bin 0 -> 671 bytes tests/apng_images/052.png | Bin 0 -> 671 bytes tests/apng_images/053.png | Bin 0 -> 671 bytes tests/apng_images/054.png | Bin 0 -> 834 bytes tests/apng_images/055.png | Bin 0 -> 687 bytes tests/apng_images/056.png | Bin 0 -> 687 bytes tests/apng_images/057.png | Bin 0 -> 671 bytes tests/apng_images/058.png | Bin 0 -> 398 bytes tests/apng_images/059.png | Bin 0 -> 405 bytes tests/apng_images/060.png | Bin 0 -> 622 bytes 61 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/apng_images/000.png create mode 100644 tests/apng_images/001.png create mode 100644 tests/apng_images/002.png create mode 100644 tests/apng_images/003.png create mode 100644 tests/apng_images/004.png create mode 100644 tests/apng_images/005.png create mode 100644 tests/apng_images/006.png create mode 100644 tests/apng_images/007.png create mode 100644 tests/apng_images/008.png create mode 100644 tests/apng_images/009.png create mode 100644 tests/apng_images/010.png create mode 100644 tests/apng_images/011.png create mode 100644 tests/apng_images/012.png create mode 100644 tests/apng_images/013.png create mode 100644 tests/apng_images/014.png create mode 100644 tests/apng_images/015.png create mode 100644 tests/apng_images/016.png create mode 100644 tests/apng_images/017.png create mode 100644 tests/apng_images/018.png create mode 100644 tests/apng_images/019.png create mode 100644 tests/apng_images/020.png create mode 100644 tests/apng_images/021.png create mode 100644 tests/apng_images/022.png create mode 100644 tests/apng_images/023.png create mode 100644 tests/apng_images/024.png create mode 100644 tests/apng_images/025.png create mode 100644 tests/apng_images/026.png create mode 100644 tests/apng_images/027.png create mode 100644 tests/apng_images/028.png create mode 100644 tests/apng_images/029.png create mode 100644 tests/apng_images/030.png create mode 100644 tests/apng_images/031.png create mode 100644 tests/apng_images/032.png create mode 100644 tests/apng_images/033.png create mode 100644 tests/apng_images/034.png create mode 100644 tests/apng_images/035.png create mode 100644 tests/apng_images/036.png create mode 100644 tests/apng_images/037.png create mode 100644 tests/apng_images/038.png create mode 100644 tests/apng_images/039.png create mode 100644 tests/apng_images/040.png create mode 100644 tests/apng_images/041.png create mode 100644 tests/apng_images/042.png create mode 100644 tests/apng_images/043.png create mode 100644 tests/apng_images/044.png create mode 100644 tests/apng_images/045.png create mode 100644 tests/apng_images/046.png create mode 100644 tests/apng_images/047.png create mode 100644 tests/apng_images/048.png create mode 100644 tests/apng_images/049.png create mode 100644 tests/apng_images/050.png create mode 100644 tests/apng_images/051.png create mode 100644 tests/apng_images/052.png create mode 100644 tests/apng_images/053.png create mode 100644 tests/apng_images/054.png create mode 100644 tests/apng_images/055.png create mode 100644 tests/apng_images/056.png create mode 100644 tests/apng_images/057.png create mode 100644 tests/apng_images/058.png create mode 100644 tests/apng_images/059.png create mode 100644 tests/apng_images/060.png diff --git a/tests/apng_images/000.png b/tests/apng_images/000.png new file mode 100644 index 0000000000000000000000000000000000000000..0ab44c39e40c316b03e51f0177d8cdedc9c2a752 GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQU^R;978JRygg?q$iTqCp!j?G zH3^=7fekayX4?pKvnPFY(2?sn%Dk~cL5%;%qsE9qCfH(S{NwPZgKs|^2Kt4;)78&q Iol`;+01gFMi~s-t literal 0 HcmV?d00001 diff --git a/tests/apng_images/001.png b/tests/apng_images/001.png new file mode 100644 index 0000000000000000000000000000000000000000..0cd5bea856b6ed89d5a57d2bef5daaa02e59f3df GIT binary patch literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw5r`SK=)PP4q@>ay zVj!UgAa(#^2uNW_0jd;ub_U2j;OXKRQZeW4IYU99F${{or(cuc`4`wQ^K7<_KsS5R tM+Y6bj-$*QD-^`|k34FO7-WJiR>nULZ#ww)!(ouuJYD@<);T3K0RX?tVKD#z literal 0 HcmV?d00001 diff --git a/tests/apng_images/002.png b/tests/apng_images/002.png new file mode 100644 index 0000000000000000000000000000000000000000..db7581fbdfcbebdcd3d442261782f8e1b3966395 GIT binary patch literal 470 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw5r`SK=)PP4q$Yd1 zIEGZrd3$LgBZGlJ%ZA(aFW*aux*Soyk?VfFjy-{ar-9Lcf$ac;1OqeKoJTwY=?xal zMlJ2~33=9lXX%Hs^nGpYg7+{dXkOK6Gz_T+z-jTEv z#}FXR2=vG~LqVWV85Dm{zb3)+FR)?e*=!quZuX>)4mxrjN0~QPD2VYNdDIv&$OK!g XjDH;7B+zBD7vwunS3j3^P6pVjpGRSfL=sf8lJ2~33=9lXX%Hs^nGpYg7+{dXkOK6Gz_T+zo=RGZ zV+fFD1bXD0p&-zw42r*}Uz6bZ7uYcKY_^R+H+#}Y2OYVNWbO+wKy^!?>Y0u*Z>&%d j<3IAKF#@4zPzbhI8UHxEsV{7@FUYr^u6{1-oD!MlJ2~33=9lXX%Hs^nGpYg7+{dXkOK6Gz_T+zo=RGZ zV+fFD1bXD0p&-zw42r*}Uz6bZ7uYcKY_^R+H+#}Y2OYVNWbO+wKy@ro^-Qmio%aRu umq7W7#>= zT*p!7jTH)F{6`)&Mhr5+7AxZ)hc~5M2;K;ZpcrZZVh13G0B~#sd>6Y5 yIhq!GVEMUy-j8q{h?L&t;ucLK6VQmViD0 literal 0 HcmV?d00001 diff --git a/tests/apng_images/009.png b/tests/apng_images/009.png new file mode 100644 index 0000000000000000000000000000000000000000..77694ff1d1550ce7f0bd8148bedef99b8ce406f4 GIT binary patch literal 508 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(o$&< zF(4D70mJ|UE`}5aMl~V*2SDCrPZ!6KiaBpDEo5Xc5NO$OyZ+^S2~n3L$~SV|uh+3B zFz_@m8ZfXOV31&7CY$q!M2F2gguSxLy3v8HqHrqy^n?32H rgN|IsQRa;m3S#_69yLY`GQk!r;~$4NrCbQ!2=bn%tDnm{r-UW|EYy*$ literal 0 HcmV?d00001 diff --git a/tests/apng_images/010.png b/tests/apng_images/010.png new file mode 100644 index 0000000000000000000000000000000000000000..1c15f132fe7da93954e03fa54f7da6987463a751 GIT binary patch literal 780 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw8HgEozUm4C(vv-1 z978JRyuGxLk-WO`Nq62i1_lPHG>DUdOo)F#3^3qgNMT@96ViVG{j6jc^GZX~+ltJ-ubCKsZkpE(`~rwtoMgjwh6V=)Mx!mV>p*He MUHx3vIVCg!0N<_7&j0`b literal 0 HcmV?d00001 diff --git a/tests/apng_images/011.png b/tests/apng_images/011.png new file mode 100644 index 0000000000000000000000000000000000000000..858f6f0382b3256d970c2359b689153d39bb491c GIT binary patch literal 508 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(o$&< zF(4D70mJ|UE`}5aMl~V*2SDCrPZ!6KiaBpDEo5Xc5NO$OyZ+^S2~n3L$~SV|uh+3B zFz_@m8ZfXOV31&7CY$q!M2F2gguSxLy3v8HqHrqy^n?32H rgN|IsQRa;m3S#_69yLY`GQk!r;~$4NrCbQ!2=bn%tDnm{r-UW|@*$CG literal 0 HcmV?d00001 diff --git a/tests/apng_images/012.png b/tests/apng_images/012.png new file mode 100644 index 0000000000000000000000000000000000000000..3f9b3cfae76a32b65fb8683d105fb989463d079b GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(o$&< zF(4D70mJ|UE`}5)MiCX?Bp`3Hr;B4q#hka77BVsz2()atUH|gEgs96Aklg)X=Baq%;!F)tg;T%IDTZgg397a4swxTxU`&cn Q>jo+FboFyt=akR{05Nn<@Bjb+ literal 0 HcmV?d00001 diff --git a/tests/apng_images/013.png b/tests/apng_images/013.png new file mode 100644 index 0000000000000000000000000000000000000000..4e1dbf77e45a3e961fa33743f39e76b419369761 GIT binary patch literal 613 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw8HgEozUm4C(o$&< zF(4D70mJ|UE`}5aMl~V*2SCL#o-U3d6?5KRJjlslz{9-p&HfVaWfzp&Km0#ntiSwY zLxhcj7=Oo6<|O>grOewNe6o;Tz<=R!NrRn3|7FHs47PskFPOg!F2O$bBaaw2RygR$ z33L-;zGBuXIK1gc+u1r`sKG*$5y*A`Vg)D`U;u~aNtWf?fFj9hDUKmPnyF&W({qNr zAeO@K>DMG=`j}K~k26d0XV@(G*l>&jMgy-#)rUvE4uvOxhQk~Mj&>j)1||juRt84lLx(|944$rjF6*2UngH^+!bJc8 literal 0 HcmV?d00001 diff --git a/tests/apng_images/014.png b/tests/apng_images/014.png new file mode 100644 index 0000000000000000000000000000000000000000..427b829a025ea8c02ef23ba4c2fd6b080841c331 GIT binary patch literal 327 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(o$&< zF(4D70mJ|UE`}6FMte@Vg+Sh9PZ!6KiaBpDEo5Xc5NO$OyZ+^S2~n3L$~SV|uh+3B zFz_@m8ZfXOV31&7CY$q!MbP0l+XkKa!_Og literal 0 HcmV?d00001 diff --git a/tests/apng_images/016.png b/tests/apng_images/016.png new file mode 100644 index 0000000000000000000000000000000000000000..f326afa5c279daccc38bf482596db2e1f88a8577 GIT binary patch literal 677 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw8HgEozUm4C(vv-1 z978JRyuGxLk-WO`Nq62i1_lPHG>DUdOo)F#3^3qgNMT@96ViVG{j6jc^GZX~+ltJCG<`kINc_xc}BphyhV*UUg)UjX{rK;ZC(59)tg z7cP|B@_Wzicj=cIqnJw?t})0iFm+(h;JrWsmtW!2her<<`yBw<19J@vkj)6iKne)J paUij`>>ZHJ4|NS|#hl~>2B6DX85ld#`}INUJYD@<);T3K0RZKi!1@3H literal 0 HcmV?d00001 diff --git a/tests/apng_images/017.png b/tests/apng_images/017.png new file mode 100644 index 0000000000000000000000000000000000000000..d90c54967b6899c395d1d749401ba909e58c6d34 GIT binary patch literal 671 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(vv-1 z978JRyuGxLk-WO`Nq62i1_lPHG>DUdOo)F#3^3qgNMT@96ViVG{jDyf4D~bf`fKG#X1QhlSK(PJJ#x-a5Ex|)iod5{ zli>Lm*f8^Kwv9kHd(uY-9l4I9%o{5d#Q2XqYK$0Uf-P3YKMrsDXV%jN@}8%wpUXO@ GgeCx%x4t(3 literal 0 HcmV?d00001 diff --git a/tests/apng_images/018.png b/tests/apng_images/018.png new file mode 100644 index 0000000000000000000000000000000000000000..0f290fd7fdbab8db7e78ae0d2a1183048e04cb0b GIT binary patch literal 534 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(vv-1 z978JRyuGxLk-WO`Nq62i1_lPHG>DUdOo)F#3^3qgNMT@96ViVG{jDyf4D~bf`fKG#X1QhlSKzopr0AAF5p8x;= literal 0 HcmV?d00001 diff --git a/tests/apng_images/019.png b/tests/apng_images/019.png new file mode 100644 index 0000000000000000000000000000000000000000..1af30f81f7ec151b1c32f2efec4723054b285877 GIT binary patch literal 614 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(vv-1 z978JRyuGxLk-WO`Nq62i1_lPHG>DUdOo)F#3^3qgNMT@96ViVG{jDyf4D~bf`fKG#X1QhlSK8Ouig-|u<6 zCn&5~VPELEyyA@w12ft2fQZO*%m_Bt7|xM6Q=<5=?cYsikSjf1{an^LB{Ts5MtzdM literal 0 HcmV?d00001 diff --git a/tests/apng_images/020.png b/tests/apng_images/020.png new file mode 100644 index 0000000000000000000000000000000000000000..3fe0f4ca789063c338ed8d3de74cddd44de7ffc3 GIT binary patch literal 579 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xe6x)whJ(vv-1 z978JRyuGxLk-WO`Nq62i1_lPHG>DUdOo)F#3^3qgNMT@96ViVG{j6jc^GZX~+ltJ@~ literal 0 HcmV?d00001 diff --git a/tests/apng_images/021.png b/tests/apng_images/021.png new file mode 100644 index 0000000000000000000000000000000000000000..3ee5fe3bf27103ec8d8101e44f83677b9999fa65 GIT binary patch literal 28791 zcmdU$X`IjH8pi)amaJo}+2tTf$QI3*o0O$lQCa9I2*DMrq0)x2rDVRNr!EDQ_P4o_WsGWpWA zQpKC6SI+F;;@GG>384ZhVYNfKw}(oFa{k{RoGTFCGv)D|=?_#q7#fs&d|jCv_CNkr zRPoH6>tCJp^36~vRJwh1+$iX^AAPrTzJNsy< z0)IZ6^6r7Yk>Qi_Bwd$B%8%cbbKS6tB?_mX8{P45_AgT#*S)oKefY$BTj5aZ9CUFe zP?(|a8+$u}zS>de95(lYqh1(&cPQ9}E+1*I=6cHRoTUr*id^t_C<%FOr;9lv{o;fhy?F3tq9*IQQRJG$Z(_6F}z*UfS|i zyXcBn#2dWHn;Pb4xZ*|7#hE|>UZ3b>b7RFT>J8q=-y+^;xZ;`jUE)k2d%diJ&(RgH zxHotkvcW7jjnhly}@gq|D`(&SG-bmaVC(xUih{1bj5qX8@zkX zSAWHD#WQcc#F;?$dgCI^E283+@dmF@X#DdGSG=-xaVC(xUQFCTy5g1d253=ba5t-yAWn4D_(87I1?zq8ymBr3tjQ*c!M{mV5epbSG>pQ;!L0buh)sepU@Srt~YqS zTP0^OT=DAB#hF0%df{OQ>55n18@z=#N>*mL;x(X)GlA^&#${BaD_%oy@Y<|>Yy-m; z&%FN>X9C&lWt|^RSG-2v;QexMdkVu9uQ6Sm31qL=we}3U;yvLFUg^&-n5SckXP#z? zGlA^&mN&adSG*{1@G^2w`GMhz*Mu(41hUtQek+Wwc+uYARc^Ly5W^Ku=xQno@ZKy^ zcQak_ntFrRtV(7%hAUn(x;PUkz@GY`T-KcrCoan>c6fWrizWOS(7{$X;*Rzz^t(*UB5b zI>(xwVYuS8ri(Ly?Dd)~evPhp&v=8keP+*ihAUnSU7QJIuXp2c0lMPFdV`nu(ZXLc zT=C-Q;!GfWy`&r$=!zHb4c_fO51Vgc70-P67iR(mcw@S5G~X2}-m~7|E!lp>JbzZa zwsdhOP=GfetA}|!uXz9T2CrS}-uoG@c#e3cxyrYi|?aXk+>qHl40@>@u zR59NPDqd%A@T$Gmc0a=v?*+Oz6Ubg~TnC{mUKelhuI+DZ?xJ`v(hZ2QmAzhg>T*6* zyqCPeD?hEm3Wh6Q0$rR56yS}%5nYL{c!}QNJvV=&c`;DDB)T{gD8TENba^jb@w$40 zxAesHbcQQlH@Y|z$X;*R{PlFj>+TKSfS$MNGhFe^i?=uv$X>5Wtoiz?cs;$rn_v0V z5{4_Dc?}e20@>@uj>tn-yx!j6Rq0pj9fm7jAG$ab$X@T{nyYlh>+22Pk%#i-X1L<@ zql+_v?DdMAdYi6z{k_2}J1Z%h;fnV%U7QJIua{P6Bwg_ac!PK4aEqP{SG<9AaVAiJ zmojd1f4brg@&<3+@RUOgSG-r~;!L0buYY)-RJ!5~_6AR)mk7fZ?^U|_*x1Tm??kCT z`B3qOc!M{7%za1uNSkwBwg`_dV}}+?u+K#q~Z;ui!*`j^`h@QLsz`l zy}{ctp>zbp74HqYI1|WTZ+Z1abj2I)4PM;?(PJ2{c;54bW8@$i+=Dp2u#hXkQX9C<+->JfGXY;Z}0|hOvuY{#hXeOX9C&lMONQP zSG;N7;ElQd)EtH@-gLS+6DYu&95vrOkx{(2yumx&c}y*aE8YycI1?zqOI#Uiek`qc zGrhs9Rbi?5t80p9o~Vd3f$a4XqZ`l_Zf$a6NFPq<=P`ugR z;Fb9C=hF;VJoD#JoC##FmwM_=y5ha-4c_YIrLHhs@!q40GlA^&A_|!&po;gtH+U~x zi87D)6mKqFoC##FmpLMwu6Xmj!F#(+d-GDRc=PGvOdxx`xHaa*U-3Th2CsXufn^!4 zcnj#_OrQX7+KOW4w>}kbp*MInbDcQHaK&3h7iR(mcuA3a%oiQSTkH+q_f7AaN4JXi zAzhpaWUqH~qxqkpcuTy&EB2q+=1acfeMA>$0@>>&^vF+FyrtgYUHEK$QHCqtGP*bu z$X>5#hYobbTkZ|si`i0<;fl9{F3tq9*BhJqC0+4WdV{xSL-(}|SG-kpaVC(xUi{5; zy5g<&2CrwKf=wB&cpuZnnLze>$E(z&E8ZG!@ZM?t&|!uvp1Gtr6DYu&nmHqiu6XOb z!P|HCS`UUR-g>$?6DYvz8rSp)UGX+}gZIRT`))E^@jju8GlA^&QtO&eTgBVx4c_k$ zEHb~+p?I6<;!GfWy@<0d=!*BLH+VU^q|Iiy;(bOJX9C&lB_1wASG>*M;BAf=V%~@; z-WIwz6UbgKJI8Ny#rxbFyq3?ksmE}|`+_dc1hUtQ8fczhE8bRb@KSzxd>6wN&%8Gg zX9C<z4W)SG;ZB;0;<+u06vQZ#!L_2^8Rs9~*X@u6Y0Q1}}VX|3(Z~yd89LCQyLa zy=X>ly5jBh2JeT-EzPeHE1r30Db574*E_zTHC^#`d4pHIPQ{K4SG?VHaVC(xUi{$2 zbj91_4PNGuTzeU=c&3Xpf$a4no86-;-dEn>b#0t|m*I-Hk1oyxve#SjRtdV|?e_+6 z#;AEcWvd%cA7{pgB!z#F_yJGYo8(~5VHF3tq9*SlGJEM4)w@dj^Y+6Va< zu6T#&;!L0bZ$ft3EV|+y_69GzX2-1zSG)|mI1?zq>z3GV1YPmI^#(6@?~&#)gW{QQ zTE&?__IfL;=B6v&ci!L~JW~97hAZAtx;PWaUN0)^8eQ>@d4m@{y><-46)%%6&IGd8 zi%Z`?SG?oi;H93~k<4(#J3$v`0@>?jmh41Vyp!JG4SD}3^J%Ae<`Y$%31qJq(Y+#F z@lJVzx3%iD@(fqJ({ynrkiA~&rmyIVcg7pMn4}d`8LoI|>EcYF0B>SK@UU0$e((nG zzQLh^Kq%fhx;PUk!0UPQwE5wR;+^*fFRNjdvkX_ff78X8K=yi(tIP|&;$83tFKS|J z5r!+?k92V+kiFiDWb;d{iuaQ@cwZmvHJagycabj61hUsV9%ufhk>XwQ25;!-_sq`~ z6z^xcI1|WTFMgi+0;G7qc!M`?*R}^4u6UQ};!GfWy|LGB&=v2BH+XTwj(y8;#k)!u zX9C&l6^$%MSG;T9;BAZi?Ma3!-mi3VCQyJkDPmGVy5e2;2Jiek_06Z9;+dZ$h%%~1hpRRaW-r$`WFw8t=P(1UaOmQZVy)N|_6Dy;jV`$uu6VcT;!GfWy_I`w&=v2tH+a*#t!cn;#k)fnX9C&lMU~k>SG>F4 z;3Za^_z}Yu?>}^LCXl^ec5m}@TgCgs8@%Q7&Y54QQoKLu;!GfWy~Hig(iQKXH+UV7 S@7ZH0T0Irl{NrW`WBv*$XltH zMuehfnSE}uD0Nejk>J##(uIgAE(#&aAgYZOY4m?{y3nd1THFJ_x##~@zjNNa_fBsq zDX>H*MKi`MzC!OdoC0u@5x*m2H8nUQf}Uaz)9SBeziZo#Y$_}F7vZ!5t*bj2fwRTu z_4unhKa5<}n9Ew*Gg&kJ(QfmG(#H=JygVKmU}mAYm~nvFnc<(ql-U{-s|_JX+Auq4 zY{=oA+8-|E*~SO^jx<%xFvgN9Nf|B8r#In>W))1!h|7A76soN7_;G3&WH>t(ld>h> z+sEwYA6rGo&_1`dDRR$ezQWn?#L!!vmJkz~II!ne_;7K*Wo4Y_2)@f`+~mqMtDhk zGkO6yprYM>8QP90?JcUuUeaFwvU`-UR#&>0$$QS0lfemP|@zYC&v(_eWEJ%4_jM0;3e(t=mp?_igrKoUVk%5 zdxt9a%hxyez)RXEp%;JyD%$<#HRXuXez7X{&F3=Sz)RXEqZfb!D%ySBCI_OlPf^9b qK5lj=yrjJoy#O3g(eC5Ve?pY@sjAq!`wR6i6!Ybmc<*csocsxOE6&FN literal 0 HcmV?d00001 diff --git a/tests/apng_images/023.png b/tests/apng_images/023.png new file mode 100644 index 0000000000000000000000000000000000000000..4f4afef50f7af6ab16af0fff2ef9dc4609aecc7b GIT binary patch literal 3486 zcmd6oPe{{Y7{}jVvpJW`=~`~9*&@=QVnP=qrFZp{rPY#HQD880xJw27ISdc(r40H5 zb%;nyiaM2sq=ybABs4k{?XZIxLR1jZ`X>~VqC?-`o*w8FnDb-}l`a?N!)P81z z95Vj#s}}F{O|43dNLrGS#K0XRaKtnf)T{w=&Dhst#@#Mp4lw=j_k46CrXy_`_2d*NrO1YLQ z?Q-j8lw=hLb_FD$p{tA>dVBRpy@WL1Yz|mMWu#fz>F6eN-f*ELtJGjuKmwYQ%F|+RDB zRhk{v_Z+KuwNx3;M^B+7t1QK?fCMyjmEoBwL{_QQQstvun?*@h@nKg$0vfu?%fdNC zR`F}8GLc);fs(8ez^;Gfy|lw_6V*cFg~hOTmYyC0ENf?BFn p6=q+dB&*b6S3m+9x{7CD7Lip}XsNO{Jv3-_ZflL1qgxUue*>9^KxO~{ literal 0 HcmV?d00001 diff --git a/tests/apng_images/024.png b/tests/apng_images/024.png new file mode 100644 index 0000000000000000000000000000000000000000..d0418ddd75f560ed4759fcb1819908d0b13e2094 GIT binary patch literal 508 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQc`KjAwEDF1R8+Y0f-@hiy?)9 zQB6qy0g%g)2vNlZWHYvOEq(^1Cwsa$hE&XXdubsfgMmQHhTHWo-%E(P98tcJ>wdkC zJ%NFzfzg10?Er%W12fs2M?3=Q4HnEtBo)pv6tZ;~JIrCkBV;RjWP&YL#y<{kO1Tic5#&8jS3j3^P6WO`Nq62i1_lPHG>DUdOo)F#3@|WaNMT^y?tEuCkk_4- z;ur#?8NnXmWnkbryy4&flJ7^BG)m53SMfZZ{+y8#_rn69K#o9QBphT2k~qBS*6zOb zKrQLqH11@o(EqRe{{?P{%VvV}XIA!Qg*=)Omvq8~hT=(qGPc&%kp) znb^Q1E{G{tb%*g{>(WUT(_i)hy#VtlC}A}Ku>%l;fx3X70t2Jed%H70E-aQ<2T3fc z@7H$+It%7_P)2D0Vh13G07eEN{3Md<0OZ1AiG2vh(v}Uq1t1@Jy85}Sb4q9e0CA}q A!2kdN literal 0 HcmV?d00001 diff --git a/tests/apng_images/026.png b/tests/apng_images/026.png new file mode 100644 index 0000000000000000000000000000000000000000..3f082665c99b80844f299d8f2f6a0eb7870e6e54 GIT binary patch literal 646 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQjWO`Nq62i1_lPHG>DUdOo)F#3@~5>dV^7R#>!+MuRATp zF$736f<3~^z`%2O!@vI}-;XS5l$^n?;(0p#IU^;S|Nz{miEpFECS26DGU9nTDn1qO}=ga7qW=M6S&@JlF5e>v+t1J40v hVgrx3Af{Z^9mb2TOD9!Kf7u7}k*BMl%Q~loCIA}msxbfn literal 0 HcmV?d00001 diff --git a/tests/apng_images/027.png b/tests/apng_images/027.png new file mode 100644 index 0000000000000000000000000000000000000000..99d53b71812981b822516b5836860d2e6626e917 GIT binary patch literal 646 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQjWO`Nq62i1_lPHG>DUdOo)F#3=pXQ|NkEYW07$QACS|X zmf{!!q#3~;;bmapIlSTD|B~-VmNZJvU{~=xo&KDW68FObpg@j5U?d!52$DFw>DKPP z^+4yq91jZb1|W6-Vlem*1PqJ~*KcwFx!a+RXNJZC14o0w|N5x&1{*f`C6uMVob{f8 k=YTS?fk#{rQ?BX`;w78)78&qol`;+0E1_+Z~y=R literal 0 HcmV?d00001 diff --git a/tests/apng_images/028.png b/tests/apng_images/028.png new file mode 100644 index 0000000000000000000000000000000000000000..bad60c767fbec09b0e188724a2f9bafc3c83035d GIT binary patch literal 646 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQjWO`Nq62i1_lPHG>DUdOo)F#3@|VPl8is*?vDo2-DxR~ zAs{~3BfJa@Jcl>@`(N_?$dX3M8SE;ar_-M^QsRDC02Ig(2#kb-3_%iyH{IIZw;t#m znBzg=-2lW6Knw=VFPL92Fg~3ZE(GLmhdQ1a8Vd{@4F><~qs|*_*x;8?mi}_qdj_5Z i%ESg9aY0PEsymDqTbE9%nEtX4WO`Nq62i1_lPHG>DUdOo)F#3@AupV9Z%$?g->{r=>WC z0BJ_BM|c?+cn)v)`@iJ-ktI!%GuTtqIQy?MQ|t+#0Sn{^1jd6yOuSc?PO{r;(gJi2 z%<)V>b^{PQ05JkEo_o~}a`ZN+j=%%3bkb^{PQ05KRaeqnyW!1$o&-vb~Q7D=o~k@OE7NsYir zQt>>U{+yALL;S}I!2AN__@{@yH3GTY wp^?OnHImZ7k#sWO`Nq62i1_lPHG>DUdOo)F#3@}JxNMT@P5O{V5$lIQl z;ur#?8KE9w;Ak-TUmtbeV8aH#gtGLPv)(iC98f0Ke&Sq7xvD#i7h9K3l52_n2y{Bk zqoBBH0AdFqh5)cf-?o{m0=eB#k1~Tj%FDpOb9lqQ|0Um#ENPUS!LH(YI{i5#B@qRS g=>jWO`Nq62i1_lPHG>DUdOo)F#3@}JxNMT@P5O{V5$lIQl z;ur#?8KE9w;Ak-TUmtbeV8aH#gtGLPv)(iC98f0Ke&Sq7xvD#i7h9K3l52_n2y{Bk zqoBBH0AdFqh5)cf-?o{m0=eB#k1~Tj%FDpOb9lqQ|0Um#ENPUS!LH(YI{i5#B@qRS g=>jvKg9s)$(}Bb zAr*7pURub=U?9-4;dcGY_Y$HmN0e{mx?itjPhj9_U^HN0JHQ~pz)Uvh5syH6g9Y;u zNriI^g=`(h4s#gs2-%9>IJ~K(JMS9<1A|l=#K}M=#6KVg7^E(QhG#LD^k2-I#VS`^nS^CRa?-_UwC=+Wxajv9X)g8u*txG4#wM2geIvwUw zP~0>Cu>%l80NA5%+e}q~+-|5xnZX|AWnkbryy4&flJ7^BG)m53SMfZZ{+yALh=Rp* ffgFKYPdLaBByo7t63cthAXj?2`njxgN@xNADc-2k literal 0 HcmV?d00001 diff --git a/tests/apng_images/033.png b/tests/apng_images/033.png new file mode 100644 index 0000000000000000000000000000000000000000..1210e3737978e5b6b8d0d94817c31ecc5eedd389 GIT binary patch literal 915 zcmeAS@N?(olHy`uVBq!ia0vp^4M6N5zy>6n+!osaDUQVC5Fa4T1jLLjU5lRq>93wH zjv*Cu-dn(fk&GmC4y1m@KBPnjrhBC(ymQrCx8JUl?DkEAQKW|AO;w4F{Cgs zstM^o0P?=2r8tHFX+}^`ZR7<8)!_|){+Dn);pAN^zHXLH@om+gt1B5i*&U1w_!V9< zc(6TVRFP#kdBCP&3A2La4E6~n3@Xf@87A>Hq$J2WTwax76)N7pgyTIh{-@E#99yo47eCl z7#P)r^dA6uwrMGjAwZfDWS=4J?r;ABq&O0jLwtZV6A&}DbS-`cq*r*l zIEGZrd3sKfk%57SW#RkyUt-LLjp?i79y9i`o5)?La2O1X1ANg(E*;8W+3^GDW~nrY zKY&b#CqWD_;9^K&U{n**e*omIPD^nN0n&^h-x=}(SxgGQr(cth>0?r{JGz&wOqDZfXLl-|m`OIb=8RU65M9yoK!r!&*i#N1N= literal 0 HcmV?d00001 diff --git a/tests/apng_images/036.png b/tests/apng_images/036.png new file mode 100644 index 0000000000000000000000000000000000000000..11ccfb6cba02b18bf51522560f32ee14e258124e GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`$P6T3NW8THQfvV}A+G;{jQBpW%Pz8~J@eE=OW=h!2ov0%FFNuEo!Qw4|qtV@SoE9$hw%zO>_YhLm+E_&$KhMK@Nu*3UW;Y5IX=d1f+lrecNWL3gp5JWd<6` ip~@iPCW>Zk03*Yi*(>Cu{0{8~>GpK>b6Mw<&;$TsI!8PJ literal 0 HcmV?d00001 diff --git a/tests/apng_images/038.png b/tests/apng_images/038.png new file mode 100644 index 0000000000000000000000000000000000000000..e95425ac1949c1c6c6a2d6f3cfac4fbd044b6d2e GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`$P6T3NW8THQfvV}A+A80f#H8gYM2v{W-1Bt z3;y50!M`~R$m2*%4)Fnr0x@Gt*WzbDTFBGIF{ENna)Jcw;slW%rcVqEEDj8eKU)RA z17)SsAUc3dh;<+a7;rJ9FfghK=|2GS#L`k6Lx40Rra9RGhZTS_FmpgQHvq8%5JNx; w$eg!rrm8@$G}IhspgBMK*(BUpA+ST3fq~iMkDhVqzopr0DPA>zyJUM literal 0 HcmV?d00001 diff --git a/tests/apng_images/039.png b/tests/apng_images/039.png new file mode 100644 index 0000000000000000000000000000000000000000..5b68c7b44091bfd9103f419e1a8256abf56a2f97 GIT binary patch literal 450 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQU^R;978JRygg?q$iTqCp!j?G zH3^=7fekayX4?pKvnPFY(2?sn%Dk~cL5%;%qsE9qCfH(S{NwPZgKs|^2Kq%REjh#o zNP|EF5IX=d1f(#eFfcL*JUavAPESj53<1)NKwn>4$jD$I(6Zrn{mb_fqAo|2Z{)gP zuVYVO;AvnqU|>7IAi=;)Hs=wKKzf4(^ASmfa}0%S9mWoG81V?%irzT9X+@D>9Rm<} My85}Sb4q9e0JHXquK)l5 literal 0 HcmV?d00001 diff --git a/tests/apng_images/040.png b/tests/apng_images/040.png new file mode 100644 index 0000000000000000000000000000000000000000..213f88549691e4c6c8fd9e5931c86ccc822efdde GIT binary patch literal 490 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw5r`SK=)PP4q_Bw{ z@N{tushIQjoS`640fXZ2>DMH9{slJ7JezGJ(9NFo(LqP9<0$jS3I#F#Baa#*2AN=s zmGO_mn-0GHa2V)6sWgb6flNq%fEZwq!jJ+C34v#4fV}BxDUKmPni1&hOA8qp3 z+^&E5UP9F6i1LkG_v>}+2@E_9j0OyB2N)z6n91fm;t@!1uwXtSsc?>=kgdbmVGbi6 ZAzRTKhc~S#60BnY0#8>zmvv4FO#rqikzD`) literal 0 HcmV?d00001 diff --git a/tests/apng_images/041.png b/tests/apng_images/041.png new file mode 100644 index 0000000000000000000000000000000000000000..296a29d4c117a67b5d81e62f85460e965f9e8567 GIT binary patch literal 470 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQU^R;978JRygg?q$iTqCp!j?G zH3^=7fekayX4?pKvnPFY(2?sn%Dk~cL5%;%qsE9qCfH(S{NwPZgKs|^2Kt2~F*(Es zNHYR4!xr6_3xJeV8bk~v)BwZ|KnwvX3@JdB0?*C>xzp2997BLKBQPW`Eo5Xc5NO$O zyZ+^S2~n3L$~SV|uh+3BFz_@m8ZfXOV31&7CY$q!MeYzrG<GfthU1BOZbD1`FmRk_zV-3fVf09p*6N a5waD%ad^{;BEdQaAnvil23_J~t1`KQm7$g{&$>u!b s5lC;aU_K(LaE_snt;5)14kI2RThSYbH`%l7xxfGfp00i_>zopr0Oh`s_5c6? literal 0 HcmV?d00001 diff --git a/tests/apng_images/045.png b/tests/apng_images/045.png new file mode 100644 index 0000000000000000000000000000000000000000..0cb7ea36e3e338376493f0a9d2cf95388528afcd GIT binary patch literal 65 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEDF3_5)e2!I%#u6{1- HoD!M6-9z|3;S|N0QSh+Hd9p~7v>S>LFf_RYd5?=F7|Zwb6Mw<&;$VG CGQU&+ literal 0 HcmV?d00001 diff --git a/tests/apng_images/048.png b/tests/apng_images/048.png new file mode 100644 index 0000000000000000000000000000000000000000..bba9cdfd580905ba8cda7da28114dd886dcceaf5 GIT binary patch literal 671 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw8HgFqz1?*HNFDHW zaSW-L^Y)yfAW#8=;_vC#BzXP>Hq1PmZ6nalp7hZ{N3P>2^TrAVG5#Zu8Y2doV2hRU zkHeb|zWs0*=ohIpi2s00i045JFi2rYVPIqscy4D z`j_t|L|u+3-^g{pUdNumz|+8Jz`%BZL4tvqY|bMdf%FCo<|C2{=NJmvI*c9WFyaxi z6}@qI(~2U&ItGMCn1JjCAa(#^2mpKJZJVhokPGt&^C0wy@3k9VAQyYO`njxgN@xNA D)~>)I literal 0 HcmV?d00001 diff --git a/tests/apng_images/049.png b/tests/apng_images/049.png new file mode 100644 index 0000000000000000000000000000000000000000..6b7acf13a6bfdb70f9589136250d503c92a4b628 GIT binary patch literal 671 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw1&A4H&Zb=eQU^R; z978JRygg?q2voqJ_&%k+*H8sz5HxBg}))Bfi&ec!6B(>FVdQ&MBb@ E03UY0YybcN literal 0 HcmV?d00001 diff --git a/tests/apng_images/050.png b/tests/apng_images/050.png new file mode 100644 index 0000000000000000000000000000000000000000..ca7b13ab8ab4b98440130010f01e9396b44ea923 GIT binary patch literal 470 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwED+Mj)HvxmZpWkUHS$ z;uumf=j}N|L7)N##oyDfN$~s&Y?ygA+eV<9J?W!^j$Fr4=8Y8!V*E!QHAW0F!4@my zABQ&`eEZ=r&@WPHK>vaK1_TX2>;S|Nkiw7x^tHgVGeGY2v=qk>Ak7H$^`(W33m_5=o=21Wx0wgU_j49sM69`OjIH&`$qkyJRxP{`I{>@bHB akC3hCjl-K(6baTb0D-5gpUXO@geCxpsf~XC literal 0 HcmV?d00001 diff --git a/tests/apng_images/051.png b/tests/apng_images/051.png new file mode 100644 index 0000000000000000000000000000000000000000..5e040743a1d8d9e7ebba15fe25e11880089edc09 GIT binary patch literal 671 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQU^R; z978JRygg?q2voqJ_iyb;Spvay8(zDfEWV69x3~J|09qK^9aiz^vJ0h56^;J?CI*~vd$@? F2>@j$!7%^; literal 0 HcmV?d00001 diff --git a/tests/apng_images/052.png b/tests/apng_images/052.png new file mode 100644 index 0000000000000000000000000000000000000000..25dd9bcd868d800a06db1f42bc0b9f6ca16c6584 GIT binary patch literal 671 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQU^R; z978JRygg?q2voqJ_|p=^ literal 0 HcmV?d00001 diff --git a/tests/apng_images/055.png b/tests/apng_images/055.png new file mode 100644 index 0000000000000000000000000000000000000000..5d951ffe2a589325f39da5f6fbd855be2983400d GIT binary patch literal 687 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQU^R; z978JRygg?q2voqJ__GJlp00i_>zopr0QtDWJ^%m! literal 0 HcmV?d00001 diff --git a/tests/apng_images/056.png b/tests/apng_images/056.png new file mode 100644 index 0000000000000000000000000000000000000000..dc78e9bb13b09aa71a30c184ddb1f83ce77af769 GIT binary patch literal 687 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQU^R; z978JRygg?q2voqJ_V!Z literal 0 HcmV?d00001 diff --git a/tests/apng_images/057.png b/tests/apng_images/057.png new file mode 100644 index 0000000000000000000000000000000000000000..29ac75e167520753159069d8e9a5f6a0c44ecddb GIT binary patch literal 671 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw35Xd!_f9SVQU^R; z978JRygg?q2voqJ_vil23_J~t1`KQm7$g{&$>u!b5lC;aU_K(LaE_snt;5)14kI2R zThSYbH{DuL`h)@D5k?@p0f-%d7y`f^nVrld0p!9w!Z-*$vZ6?^4&-7_S3j3^P6|`DZAa{CNiem_n zW`erIK%iyA?fRGRB}840DBs9+zh1{qyaVvL^AV3gdV>Y?5lMw}425hR#tw5B@d(+9 X-Z;F;o@LJkkc&NC{an^LB{Ts5O8;JI literal 0 HcmV?d00001 diff --git a/tests/apng_images/059.png b/tests/apng_images/059.png new file mode 100644 index 0000000000000000000000000000000000000000..b8cbd5fc9263ecf84a1dd3a3ed146ac8152b2d48 GIT binary patch literal 405 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw5r`SK=)PP4qz-tx zIEGZrd3(-K5U7Ab@%Qv=5mX_ie0;Cy%zP_{&7#19dH~jto zrGl|tL22Kj%%Fd#N*UM=Fi0>kCou3dFd7iUIdF_Ywe8`heIhL$3_#%N>gTe~DWM4f DzI%Nt literal 0 HcmV?d00001 diff --git a/tests/apng_images/060.png b/tests/apng_images/060.png new file mode 100644 index 0000000000000000000000000000000000000000..622f22d73a2c2c900dc556cbaa0d9f2d82c151a2 GIT binary patch literal 622 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}DLQXGlNAwEEw5r`SK=)PP4qz-tx zIEGZrd3(-K5U7Ab@%Qv=5E4r7Noj6+b! YHtb@15ldIhbp{~tboFyt=akR{0OO;)#Q*>R literal 0 HcmV?d00001