packages: libpng/libpng-apng.patch - updated from http://heanet.dl.sourcefo...
glen
glen at pld-linux.org
Fri Dec 4 15:02:41 CET 2009
Author: glen Date: Fri Dec 4 14:02:41 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- updated from http://heanet.dl.sourceforge.net/project/vdubapngmod/libpng-apng-patch/1.2.41/libpng-1.2.41-apng.patch
---- Files affected:
packages/libpng:
libpng-apng.patch (1.9 -> 1.10)
---- Diffs:
================================================================
Index: packages/libpng/libpng-apng.patch
diff -u packages/libpng/libpng-apng.patch:1.9 packages/libpng/libpng-apng.patch:1.10
--- packages/libpng/libpng-apng.patch:1.9 Fri Dec 4 14:09:33 2009
+++ packages/libpng/libpng-apng.patch Fri Dec 4 15:02:36 2009
@@ -1,319 +1,221 @@
-diff -Naru libpng-1.2.41.org/png.c libpng-1.2.41/png.c
---- libpng-1.2.41.org/png.c 2009-12-04 21:30:08.000000000 +0900
-+++ libpng-1.2.41/png.c 2009-12-04 21:30:08.000000000 +0900
-@@ -56,6 +56,11 @@
- PNG_tIME;
- PNG_tRNS;
- PNG_zTXt;
-+#ifdef PNG_APNG_SUPPORTED
-+PNG_acTL;
-+PNG_fcTL;
-+PNG_fdAT;
-+#endif
-
- #ifdef PNG_READ_SUPPORTED
- /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
-diff -Naru libpng-1.2.41.org/png.h libpng-1.2.41/png.h
---- libpng-1.2.41.org/png.h 2009-12-04 21:30:08.000000000 +0900
-+++ libpng-1.2.41/png.h 2009-12-04 21:30:08.000000000 +0900
-@@ -1029,6 +1029,19 @@
- png_fixed_point int_y_blue PNG_DEPSTRUCT;
+Index: pngread.c
+===================================================================
+--- pngread.c
++++ pngread.c
+@@ -423,6 +423,11 @@
+ #ifdef PNG_READ_zTXt_SUPPORTED
+ PNG_CONST PNG_zTXt;
#endif
-
-+#ifdef PNG_APNG_SUPPORTED
-+ png_uint_32 num_frames PNG_DEPSTRUCT; /* including default image */
-+ png_uint_32 num_plays PNG_DEPSTRUCT;
-+ png_uint_32 next_frame_width PNG_DEPSTRUCT;
-+ png_uint_32 next_frame_height PNG_DEPSTRUCT;
-+ png_uint_32 next_frame_x_offset PNG_DEPSTRUCT;
-+ png_uint_32 next_frame_y_offset PNG_DEPSTRUCT;
-+ png_uint_16 next_frame_delay_num PNG_DEPSTRUCT;
-+ png_uint_16 next_frame_delay_den PNG_DEPSTRUCT;
-+ png_byte next_frame_dispose_op PNG_DEPSTRUCT;
-+ png_byte next_frame_blend_op PNG_DEPSTRUCT;
-+#endif
-+
- } png_info;
-
- typedef png_info FAR * png_infop;
-@@ -1130,6 +1143,10 @@
- #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */
- #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */
- #define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */
-+#ifdef PNG_APNG_SUPPORTED
-+#define PNG_INFO_acTL 0x10000L
-+#define PNG_INFO_fcTL 0x20000L
++#ifdef PNG_READ_APNG_SUPPORTED
++ PNG_CONST PNG_acTL;
++ PNG_CONST PNG_fcTL;
++ PNG_CONST PNG_fdAT;
+#endif
+ #endif /* PNG_USE_LOCAL_ARRAYS */
+ png_uint_32 length = png_read_chunk_header(png_ptr);
+ PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
+@@ -467,6 +472,9 @@
+ !(png_ptr->mode & PNG_HAVE_PLTE))
+ png_error(png_ptr, "Missing PLTE before IDAT");
- /* This is used for the transformation routines, as some of them
- * change these values for the row. It also should enable using
-@@ -1170,6 +1187,10 @@
- typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop));
- typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep,
- png_uint_32, int));
-+#ifdef PNG_APNG_SUPPORTED
-+typedef void (PNGAPI *png_progressive_frame_ptr) PNGARG((png_structp,
-+ png_uint_32));
++#ifdef PNG_READ_APNG_SUPPORTED
++ png_have_info(png_ptr, info_ptr);
+#endif
+ png_ptr->idat_size = length;
+ png_ptr->mode |= PNG_HAVE_IDAT;
+ break;
+@@ -539,12 +547,97 @@
+ else if (!png_memcmp(chunk_name, png_iTXt, 4))
+ png_handle_iTXt(png_ptr, info_ptr, length);
#endif
-
- #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
-@@ -1506,6 +1527,39 @@
- png_uint_32 user_height_max PNG_DEPSTRUCT;
- #endif
-
-+#ifdef PNG_APNG_SUPPORTED
-+ png_uint_32 apng_flags PNG_DEPSTRUCT;
-+ png_uint_32 next_seq_num PNG_DEPSTRUCT; /* next fcTL/fdAT chunk sequence number */
-+ png_uint_32 first_frame_width PNG_DEPSTRUCT;
-+ png_uint_32 first_frame_height PNG_DEPSTRUCT;
-+
+#ifdef PNG_READ_APNG_SUPPORTED
-+ png_uint_32 num_frames_read PNG_DEPSTRUCT; /* incremented after all image data of */
-+ /* a frame is read */
-+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
-+ png_progressive_frame_ptr frame_info_fn PNG_DEPSTRUCT; /* frame info read callback */
-+ png_progressive_frame_ptr frame_end_fn PNG_DEPSTRUCT; /* frame data read callback */
++ else if (!png_memcmp(chunk_name, png_acTL, 4))
++ png_handle_acTL(png_ptr, info_ptr, length);
++ else if (!png_memcmp(chunk_name, png_fcTL, 4))
++ png_handle_fcTL(png_ptr, info_ptr, length);
++ else if (!png_memcmp(chunk_name, png_fdAT, 4))
++ png_handle_fdAT(png_ptr, info_ptr, length);
+#endif
+ else
+ png_handle_unknown(png_ptr, info_ptr, length);
+ }
+ }
+ #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
+
++#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_crc_finish(png_ptr, 0); /* CRC from last IDAT or fdAT chunk */
++
++ png_read_reset(png_ptr);
++ png_ptr->mode &= ~PNG_HAVE_fcTL;
++
++ have_chunk_after_DAT = 0;
++ for (;;)
++ {
++#ifdef PNG_USE_LOCAL_ARRAYS
++ PNG_IDAT;
++ PNG_fdAT;
++ PNG_fcTL;
+#endif
++ png_byte chunk_length[4];
++ png_uint_32 length;
++
++ png_read_data(png_ptr, chunk_length, 4);
++ length = png_get_uint_31(png_ptr, chunk_length);
++
++ png_reset_crc(png_ptr);
++ png_crc_read(png_ptr, png_ptr->chunk_name, 4);
++
++ if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
++ {
++ /* 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_memcmp(png_ptr->chunk_name, png_fcTL, 4))
++ {
++ png_handle_fcTL(png_ptr, info_ptr, length);
++ have_chunk_after_DAT = 1;
++ }
++ else if (!png_memcmp(png_ptr->chunk_name, png_fdAT, 4))
++ {
++ 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 */
+
-+#ifdef PNG_WRITE_APNG_SUPPORTED
-+ png_uint_32 num_frames_to_write PNG_DEPSTRUCT;
-+ png_uint_32 num_frames_written PNG_DEPSTRUCT;
+ /* Optional call to update the users info_ptr structure */
+ void PNGAPI
+ png_read_update_info(png_structp png_ptr, png_infop info_ptr)
+@@ -584,6 +677,10 @@
+ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
+ {
+ PNG_CONST PNG_IDAT;
++#ifdef PNG_READ_APNG_SUPPORTED
++ PNG_CONST PNG_fdAT;
++ PNG_CONST PNG_IEND;
+#endif
-+
-+/* For png_struct.apng_flags: */
-+#define PNG_FIRST_FRAME_HIDDEN 0x0001
-+
-+/* dispose_op flags from inside fcTL */
-+#define PNG_DISPOSE_OP_NONE 0x00
-+#define PNG_DISPOSE_OP_BACKGROUND 0x01
-+#define PNG_DISPOSE_OP_PREVIOUS 0x02
-+
-+/* blend_op flags from inside fcTL */
-+#define PNG_BLEND_OP_SOURCE 0x00
-+#define PNG_BLEND_OP_OVER 0x01
-+#endif /* PNG_APNG_SUPPORTED */
-+
- /* New member added in libpng-1.0.25 and 1.2.17 */
- #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
- /* Storage for unknown chunk that the library doesn't recognize. */
-@@ -1840,6 +1894,18 @@
- extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
- png_bytepp image));
+ PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55,
+ 0xff};
+ PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
+@@ -716,13 +813,39 @@
+ {
+ if (!(png_ptr->zstream.avail_in))
+ {
+- while (!png_ptr->idat_size)
++ png_uint_32 bytes_to_skip = 0;
++
++ while (!png_ptr->idat_size || bytes_to_skip != 0)
+ {
+- png_crc_finish(png_ptr, 0);
++ png_crc_finish(png_ptr, bytes_to_skip);
++ bytes_to_skip = 0;
-+#ifdef PNG_WRITE_APNG_SUPPORTED
-+extern PNG_EXPORT (void,png_write_frame_head) PNGARG((png_structp png_ptr,
-+ png_infop png_info, 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));
-+
-+extern PNG_EXPORT (void,png_write_frame_tail) PNGARG((png_structp png_ptr,
-+ png_infop png_info));
+ png_ptr->idat_size = png_read_chunk_header(png_ptr);
++#ifdef PNG_READ_APNG_SUPPORTED
++ if (png_ptr->num_frames_read == 0)
++ {
+#endif
-+
- /* Writes the end of the PNG file. */
- extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
- png_infop info_ptr));
-@@ -2093,6 +2159,11 @@
- png_voidp progressive_ptr,
- png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
- png_progressive_end_ptr end_fn));
+ if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
+ png_error(png_ptr, "Not enough image data");
+#ifdef PNG_READ_APNG_SUPPORTED
-+extern PNG_EXPORT(void,png_set_progressive_frame_fn) PNGARG((png_structp png_ptr,
-+ png_progressive_frame_ptr frame_info_fn,
-+ png_progressive_frame_ptr frame_end_fn));
++ }
++ else
++ {
++ if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
++ png_error(png_ptr, "Not enough image data");
++ if (png_memcmp(png_ptr->chunk_name, png_fdAT, 4))
++ {
++ 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;
++ }
+#endif
-
- /* Returns the user pointer associated with the push read functions */
- extern PNG_EXPORT(png_voidp,png_get_progressive_ptr)
-@@ -2533,6 +2604,59 @@
- #endif
- #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */
-
-+#ifdef PNG_APNG_SUPPORTED
-+extern PNG_EXPORT(png_uint_32,png_get_acTL) PNGARG((png_structp png_ptr,
-+ png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays));
-+extern PNG_EXPORT(png_uint_32,png_set_acTL) PNGARG((png_structp png_ptr,
-+ png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays));
-+extern PNG_EXPORT(png_uint_32,png_get_num_frames) PNGARG((png_structp png_ptr,
-+ png_infop info_ptr));
-+extern PNG_EXPORT(png_uint_32,png_get_num_plays)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+
-+extern PNG_EXPORT(png_uint_32,png_get_next_frame_fcTL)
-+ PNGARG((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));
-+extern PNG_EXPORT(png_uint_32,png_set_next_frame_fcTL)
-+ PNGARG((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));
-+extern PNG_EXPORT(void,png_ensure_fcTL_is_valid)
-+ PNGARG((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));
-+extern PNG_EXPORT(png_uint_32,png_get_next_frame_width)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_uint_32,png_get_next_frame_height)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_uint_32,png_get_next_frame_x_offset)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_uint_32,png_get_next_frame_y_offset)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_uint_16,png_get_next_frame_delay_num)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_uint_16,png_get_next_frame_delay_den)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_byte,png_get_next_frame_dispose_op)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_byte,png_get_next_frame_blend_op)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_byte,png_get_first_frame_is_hidden)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr));
-+extern PNG_EXPORT(png_uint_32,png_set_first_frame_is_hidden)
-+ PNGARG((png_structp png_ptr, png_infop info_ptr, png_byte is_hidden));
-+#endif /* PNG_APNG_SUPPORTED */
-+
+ }
+ png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size;
+ png_ptr->zstream.next_in = png_ptr->zbuf;
+@@ -740,6 +863,9 @@
+ png_error(png_ptr, "Extra compressed data");
+ png_ptr->mode |= PNG_AFTER_IDAT;
+ png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
+#ifdef PNG_READ_APNG_SUPPORTED
-+extern PNG_EXPORT(void,png_read_frame_head) PNGARG((png_structp png_ptr,
-+ png_infop info_ptr));
-+#endif
-+
- #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
- /* Provide a list of chunks and how they are to be handled, if the built-in
- handling or default unknown chunk handling is not desired. Any chunks not
-@@ -2897,6 +3021,10 @@
- #define PNG_BACKGROUND_IS_GRAY 0x800
- #define PNG_HAVE_PNG_SIGNATURE 0x1000
- #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
-+#ifdef PNG_APNG_SUPPORTED
-+#define PNG_HAVE_acTL 0x4000
-+#define PNG_HAVE_fcTL 0x8000L
-+#endif
-
- /* Flags for the transformations the PNG library does on the image data */
- #define PNG_BGR 0x0001
-@@ -3039,6 +3167,11 @@
- #define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'}
- #define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'}
- #define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'}
-+#ifdef PNG_APNG_SUPPORTED
-+#define PNG_acTL png_byte png_acTL[5] = { 97, 99, 84, 76, '\0'}
-+#define PNG_fcTL png_byte png_fcTL[5] = {102, 99, 84, 76, '\0'}
-+#define PNG_fdAT png_byte png_fdAT[5] = {102, 100, 65, 84, '\0'}
-+#endif
-
- #ifdef PNG_USE_GLOBAL_ARRAYS
- PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5];
-@@ -3062,6 +3195,11 @@
- PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5];
- PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5];
- PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5];
-+#ifdef PNG_APNG_SUPPORTED
-+PNG_EXPORT_VAR (png_byte FARDATA) png_acTL[5];
-+PNG_EXPORT_VAR (png_byte FARDATA) png_fcTL[5];
-+PNG_EXPORT_VAR (png_byte FARDATA) png_fdAT[5];
++ png_ptr->num_frames_read++;
+#endif
- #endif /* PNG_USE_GLOBAL_ARRAYS */
-
- #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
-@@ -3344,6 +3482,17 @@
- #endif
+ break;
+ }
+ if (ret != Z_OK)
+@@ -997,6 +1123,11 @@
+ #ifdef PNG_READ_zTXt_SUPPORTED
+ PNG_CONST PNG_zTXt;
#endif
-
-+#ifdef PNG_WRITE_APNG_SUPPORTED
-+PNG_EXTERN void png_write_acTL PNGARG((png_structp png_ptr,
-+ png_uint_32 num_frames, png_uint_32 num_plays)) PNG_PRIVATE;
-+
-+PNG_EXTERN void png_write_fcTL PNGARG((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_PRIVATE;
-+#endif
-+
- /* Called when finished processing a row of data */
- PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)) PNG_PRIVATE;
-
-@@ -3396,6 +3545,20 @@
- PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
- png_infop info_ptr)) PNG_PRIVATE;
-
+#ifdef PNG_READ_APNG_SUPPORTED
-+/* Private, reset some things to become ready for reading next frame */
-+PNG_EXTERN void png_read_reset PNGARG((png_structp png_ptr)) PNG_PRIVATE;
-+PNG_EXTERN void png_read_reinit PNGARG((png_structp png_ptr,
-+ png_infop info_ptr)) PNG_PRIVATE;
-+PNG_EXTERN void png_progressive_read_reset PNGARG((png_structp png_ptr)) PNG_PRIVATE;
-+#endif
-+#ifdef PNG_WRITE_APNG_SUPPORTED
-+/* Private, reset some things to become ready for writing next frame */
-+PNG_EXTERN void png_write_reset PNGARG((png_structp png_ptr)) PNG_PRIVATE;
-+PNG_EXTERN void png_write_reinit PNGARG((png_structp png_ptr,
-+ png_infop info_ptr, png_uint_32 width, png_uint_32 height)) PNG_PRIVATE;
++ PNG_CONST PNG_acTL;
++ PNG_CONST PNG_fcTL;
++ PNG_CONST PNG_fdAT;
+#endif
-+
- /* These are the functions that do the transformations */
- #ifdef PNG_READ_FILLER_SUPPORTED
- PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
-@@ -3619,6 +3782,18 @@
- png_uint_32 length)) PNG_PRIVATE;
+ #endif /* PNG_USE_LOCAL_ARRAYS */
+ png_uint_32 length = png_read_chunk_header(png_ptr);
+ PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
+@@ -1097,6 +1228,14 @@
+ else if (!png_memcmp(chunk_name, png_iTXt, 4))
+ png_handle_iTXt(png_ptr, info_ptr, length);
#endif
-
+#ifdef PNG_READ_APNG_SUPPORTED
-+PNG_EXTERN void png_handle_acTL PNGARG((png_structp png_ptr, png_infop info_ptr,
-+ png_uint_32 length)) PNG_PRIVATE;
-+PNG_EXTERN void png_handle_fcTL PNGARG((png_structp png_ptr, png_infop info_ptr,
-+ png_uint_32 length)) PNG_PRIVATE;
-+PNG_EXTERN void png_have_info PNGARG((png_structp png_ptr, png_infop info_ptr));
-+PNG_EXTERN void png_handle_fdAT PNGARG((png_structp png_ptr, png_infop info_ptr,
-+ png_uint_32 length)) PNG_PRIVATE;
-+PNG_EXTERN void png_ensure_sequence_number PNGARG((png_structp png_ptr,
-+ png_uint_32 length)) PNG_PRIVATE;
-+#endif
-+
- PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
- png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE;
-
-diff -Naru libpng-1.2.41.org/pngconf.h libpng-1.2.41/pngconf.h
---- libpng-1.2.41.org/pngconf.h 2009-12-04 21:30:08.000000000 +0900
-+++ libpng-1.2.41/pngconf.h 2009-12-04 21:30:08.000000000 +0900
-@@ -1008,6 +1008,10 @@
- # define PNG_READ_tIME_SUPPORTED
- # define PNG_tIME_SUPPORTED
- #endif
-+#ifndef PNG_NO_READ_APNG
-+# define PNG_READ_APNG_SUPPORTED
-+# define PNG_APNG_SUPPORTED
-+#endif
- #ifndef PNG_NO_READ_tRNS
- # define PNG_READ_tRNS_SUPPORTED
- # define PNG_tRNS_SUPPORTED
-@@ -1170,6 +1174,14 @@
- # define PNG_TEXT_SUPPORTED
- # endif
- #endif
-+#ifndef PNG_NO_WRITE_APNG
-+# ifndef PNG_WRITE_APNG_SUPPORTED
-+# define PNG_WRITE_APNG_SUPPORTED
-+# endif
-+# ifndef PNG_APNG_SUPPORTED
-+# define PNG_APNG_SUPPORTED
-+# endif
++ else if (!png_memcmp(chunk_name, png_acTL, 4))
++ png_handle_acTL(png_ptr, info_ptr, length);
++ else if (!png_memcmp(chunk_name, png_fcTL, 4))
++ png_handle_fcTL(png_ptr, info_ptr, length);
++ else if (!png_memcmp(chunk_name, png_fdAT, 4))
++ png_handle_fdAT(png_ptr, info_ptr, length);
+#endif
-
- #ifdef PNG_WRITE_tIME_SUPPORTED
- # ifndef PNG_NO_CONVERT_tIME
-diff -Naru libpng-1.2.41.org/pngget.c libpng-1.2.41/pngget.c
---- libpng-1.2.41.org/pngget.c 2009-12-04 21:30:08.000000000 +0900
-+++ libpng-1.2.41/pngget.c 2009-12-04 21:30:08.000000000 +0900
+ else
+ png_handle_unknown(png_ptr, info_ptr, length);
+ } while (!(png_ptr->mode & PNG_HAVE_IEND));
+Index: pngget.c
+===================================================================
+--- pngget.c
++++ pngget.c
@@ -842,6 +842,167 @@
}
#endif
@@ -482,47 +384,430 @@
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
png_uint_32 PNGAPI
png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr,
-diff -Naru libpng-1.2.41.org/pngpread.c libpng-1.2.41/pngpread.c
---- libpng-1.2.41.org/pngpread.c 2009-12-04 21:30:08.000000000 +0900
-+++ libpng-1.2.41/pngpread.c 2009-12-04 21:30:08.000000000 +0900
-@@ -206,6 +206,11 @@
- #ifdef PNG_READ_zTXt_SUPPORTED
- PNG_CONST PNG_zTXt;
+Index: png.c
+===================================================================
+--- png.c
++++ png.c
+@@ -56,6 +56,11 @@
+ PNG_tIME;
+ PNG_tRNS;
+ PNG_zTXt;
++#ifdef PNG_APNG_SUPPORTED
++PNG_acTL;
++PNG_fcTL;
++PNG_fdAT;
++#endif
+
+ #ifdef PNG_READ_SUPPORTED
+ /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
+Index: png.h
+===================================================================
+--- png.h
++++ png.h
+@@ -1029,6 +1029,19 @@
+ png_fixed_point int_y_blue PNG_DEPSTRUCT;
#endif
-+#ifdef PNG_READ_APNG_SUPPORTED
-+ PNG_CONST PNG_acTL;
-+ PNG_CONST PNG_fcTL;
-+ PNG_CONST PNG_fdAT;
+
++#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 /* PNG_USE_LOCAL_ARRAYS */
++
+ } png_info;
- /* First we make sure we have enough data for the 4 byte chunk name
-@@ -232,6 +237,103 @@
- png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
- }
+ typedef png_info FAR * png_infop;
+@@ -1130,6 +1143,10 @@
+ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */
+ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */
+ #define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */
++#ifdef PNG_APNG_SUPPORTED
++#define PNG_INFO_acTL 0x10000L
++#define PNG_INFO_fcTL 0x20000L
++#endif
+
+ /* This is used for the transformation routines, as some of them
+ * change these values for the row. It also should enable using
+@@ -1170,6 +1187,10 @@
+ typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop));
+ typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep,
+ png_uint_32, int));
++#ifdef PNG_APNG_SUPPORTED
++typedef void (PNGAPI *png_progressive_frame_ptr) PNGARG((png_structp,
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/libpng/libpng-apng.patch?r1=1.9&r2=1.10&f=u
More information about the pld-cvs-commit
mailing list