16 #if defined(PNG_READ_SUPPORTED) 24 #ifdef PNG_USER_MEM_SUPPORTED 37 #ifdef PNG_SETJMP_SUPPORTED 42 #ifdef PNG_SETJMP_SUPPORTED 43 #ifdef USE_FAR_KEYWORD 50 png_debug(1,
"in png_create_read_struct\n");
51 #ifdef PNG_USER_MEM_SUPPORTED 61 #ifdef PNG_SET_USER_LIMITS_SUPPORTED 66 #ifdef PNG_SETJMP_SUPPORTED 67 #ifdef USE_FAR_KEYWORD 70 if (setjmp(png_ptr->jmpbuf))
75 #ifdef PNG_USER_MEM_SUPPORTED 77 (png_free_ptr)free_fn, (
png_voidp)mem_ptr);
83 #ifdef USE_FAR_KEYWORD 88 #ifdef PNG_USER_MEM_SUPPORTED 100 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
104 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
107 if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
114 if (user_png_ver == NULL || user_png_ver[0] !=
png_libpng_ver[0] ||
115 (user_png_ver[0] ==
'1' && user_png_ver[2] !=
png_libpng_ver[2]) ||
116 (user_png_ver[0] ==
'0' && user_png_ver[2] <
'9'))
118 #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) 123 "Application was compiled with png.h from libpng-%.20s",
128 "Application is running with png.c from libpng-%.20s",
132 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 136 "Incompatible libpng version in application and library");
146 png_ptr->zstream.opaque = (
voidpf)png_ptr;
154 default:
png_error(png_ptr,
"Unknown zlib error");
157 png_ptr->zstream.next_out = png_ptr->zbuf;
158 png_ptr->zstream.avail_out = (
uInt)png_ptr->zbuf_size;
162 #ifdef PNG_SETJMP_SUPPORTED 166 #ifdef USE_FAR_KEYWORD 171 if (setjmp(png_ptr->jmpbuf))
178 #if defined(PNG_1_0_X) || defined(PNG_1_2_X) 195 if (png_ptr == NULL)
return;
196 #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) 201 png_ptr->warning_fn = NULL;
205 "Application was compiled with png.h from libpng-%.20s",
210 "Application is running with png.c from libpng-%.20s",
217 png_ptr->error_fn = NULL;
218 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 222 "The png struct allocated by the application for reading is too small.");
226 png_ptr->error_fn = NULL;
227 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 231 "The info struct allocated by application for reading is too small.");
241 #ifdef PNG_SETJMP_SUPPORTED 249 if (png_ptr == NULL)
return;
255 #ifdef PNG_LEGACY_SUPPORTED 256 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
258 png_ptr->warning_fn = NULL;
260 "Application uses deprecated png_read_init() and should be recompiled.");
268 #ifdef PNG_SETJMP_SUPPORTED 283 #ifdef PNG_SETJMP_SUPPORTED 289 #ifdef PNG_SET_USER_LIMITS_SUPPORTED 300 png_ptr->zstream.opaque = (
voidpf)png_ptr;
308 default:
png_error(png_ptr,
"Unknown zlib error");
311 png_ptr->zstream.next_out = png_ptr->zbuf;
312 png_ptr->zstream.avail_out = (
uInt)png_ptr->zbuf_size;
317 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 329 if (png_ptr == NULL || info_ptr == NULL)
return;
332 if (png_ptr->sig_bytes < 8)
338 png_ptr->sig_bytes = 8;
342 if (num_checked < 4 &&
346 png_error(png_ptr,
"PNG file corrupted by ASCII conversion");
349 png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
354 #ifdef PNG_USE_LOCAL_ARRAYS 359 #if defined(PNG_READ_bKGD_SUPPORTED) 362 #if defined(PNG_READ_cHRM_SUPPORTED) 365 #if defined(PNG_READ_gAMA_SUPPORTED) 368 #if defined(PNG_READ_hIST_SUPPORTED) 371 #if defined(PNG_READ_iCCP_SUPPORTED) 374 #if defined(PNG_READ_iTXt_SUPPORTED) 377 #if defined(PNG_READ_oFFs_SUPPORTED) 380 #if defined(PNG_READ_pCAL_SUPPORTED) 383 #if defined(PNG_READ_pHYs_SUPPORTED) 386 #if defined(PNG_READ_sBIT_SUPPORTED) 389 #if defined(PNG_READ_sCAL_SUPPORTED) 392 #if defined(PNG_READ_sPLT_SUPPORTED) 395 #if defined(PNG_READ_sRGB_SUPPORTED) 398 #if defined(PNG_READ_tEXt_SUPPORTED) 401 #if defined(PNG_READ_tIME_SUPPORTED) 404 #if defined(PNG_READ_tRNS_SUPPORTED) 407 #if defined(PNG_READ_zTXt_SUPPORTED) 419 png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
423 else if (!
png_memcmp(chunk_name, png_IEND, 4))
425 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 433 else if (!
png_memcmp(chunk_name, png_IDAT, 4))
436 png_error(png_ptr,
"Missing IHDR before IDAT");
439 png_error(png_ptr,
"Missing PLTE before IDAT");
444 else if (!
png_memcmp(chunk_name, png_PLTE, 4))
446 else if (!
png_memcmp(chunk_name, png_IDAT, 4))
449 png_error(png_ptr,
"Missing IHDR before IDAT");
452 png_error(png_ptr,
"Missing PLTE before IDAT");
454 png_ptr->idat_size =
length;
458 #if defined(PNG_READ_bKGD_SUPPORTED) 459 else if (!
png_memcmp(chunk_name, png_bKGD, 4))
462 #if defined(PNG_READ_cHRM_SUPPORTED) 463 else if (!
png_memcmp(chunk_name, png_cHRM, 4))
466 #if defined(PNG_READ_gAMA_SUPPORTED) 467 else if (!
png_memcmp(chunk_name, png_gAMA, 4))
470 #if defined(PNG_READ_hIST_SUPPORTED) 471 else if (!
png_memcmp(chunk_name, png_hIST, 4))
474 #if defined(PNG_READ_oFFs_SUPPORTED) 475 else if (!
png_memcmp(chunk_name, png_oFFs, 4))
478 #if defined(PNG_READ_pCAL_SUPPORTED) 479 else if (!
png_memcmp(chunk_name, png_pCAL, 4))
482 #if defined(PNG_READ_sCAL_SUPPORTED) 483 else if (!
png_memcmp(chunk_name, png_sCAL, 4))
486 #if defined(PNG_READ_pHYs_SUPPORTED) 487 else if (!
png_memcmp(chunk_name, png_pHYs, 4))
490 #if defined(PNG_READ_sBIT_SUPPORTED) 491 else if (!
png_memcmp(chunk_name, png_sBIT, 4))
494 #if defined(PNG_READ_sRGB_SUPPORTED) 495 else if (!
png_memcmp(chunk_name, png_sRGB, 4))
498 #if defined(PNG_READ_iCCP_SUPPORTED) 499 else if (!
png_memcmp(chunk_name, png_iCCP, 4))
502 #if defined(PNG_READ_sPLT_SUPPORTED) 503 else if (!
png_memcmp(chunk_name, png_sPLT, 4))
506 #if defined(PNG_READ_tEXt_SUPPORTED) 507 else if (!
png_memcmp(chunk_name, png_tEXt, 4))
510 #if defined(PNG_READ_tIME_SUPPORTED) 511 else if (!
png_memcmp(chunk_name, png_tIME, 4))
514 #if defined(PNG_READ_tRNS_SUPPORTED) 515 else if (!
png_memcmp(chunk_name, png_tRNS, 4))
518 #if defined(PNG_READ_zTXt_SUPPORTED) 519 else if (!
png_memcmp(chunk_name, png_zTXt, 4))
522 #if defined(PNG_READ_iTXt_SUPPORTED) 523 else if (!
png_memcmp(chunk_name, png_iTXt, 4))
524 png_handle_iTXt(png_ptr, info_ptr, length);
536 png_debug(1,
"in png_read_update_info\n");
537 if (png_ptr == NULL)
return;
538 if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
542 "Ignoring extra png_read_update_info() call; row buffer not reallocated");
546 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 555 png_debug(1,
"in png_start_read_image\n");
556 if (png_ptr == NULL)
return;
557 if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
562 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 566 #ifdef PNG_USE_LOCAL_ARRAYS 573 if (png_ptr == NULL)
return;
574 png_debug2(1,
"in png_read_row (row %lu, pass %d)\n",
575 png_ptr->row_number, png_ptr->pass);
576 if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
578 if (png_ptr->row_number == 0 && png_ptr->pass == 0)
581 #if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED) 582 if (png_ptr->transformations & PNG_INVERT_MONO)
583 png_warning(png_ptr,
"PNG_READ_INVERT_SUPPORTED is not defined.");
585 #if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED) 586 if (png_ptr->transformations & PNG_FILLER)
587 png_warning(png_ptr,
"PNG_READ_FILLER_SUPPORTED is not defined.");
589 #if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && !defined(PNG_READ_PACKSWAP_SUPPORTED) 590 if (png_ptr->transformations & PNG_PACKSWAP)
591 png_warning(png_ptr,
"PNG_READ_PACKSWAP_SUPPORTED is not defined.");
593 #if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED) 594 if (png_ptr->transformations & PNG_PACK)
595 png_warning(png_ptr,
"PNG_READ_PACK_SUPPORTED is not defined.");
597 #if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) 598 if (png_ptr->transformations & PNG_SHIFT)
599 png_warning(png_ptr,
"PNG_READ_SHIFT_SUPPORTED is not defined.");
601 #if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED) 602 if (png_ptr->transformations & PNG_BGR)
603 png_warning(png_ptr,
"PNG_READ_BGR_SUPPORTED is not defined.");
605 #if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED) 606 if (png_ptr->transformations & PNG_SWAP_BYTES)
607 png_warning(png_ptr,
"PNG_READ_SWAP_SUPPORTED is not defined.");
611 #if defined(PNG_READ_INTERLACING_SUPPORTED) 613 if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
615 switch (png_ptr->pass)
618 if (png_ptr->row_number & 0x07)
622 png_pass_dsp_mask[png_ptr->pass]);
628 if ((png_ptr->row_number & 0x07) || png_ptr->width < 5)
632 png_pass_dsp_mask[png_ptr->pass]);
638 if ((png_ptr->row_number & 0x07) != 4)
640 if (dsp_row != NULL && (png_ptr->row_number & 4))
642 png_pass_dsp_mask[png_ptr->pass]);
648 if ((png_ptr->row_number & 3) || png_ptr->width < 3)
652 png_pass_dsp_mask[png_ptr->pass]);
658 if ((png_ptr->row_number & 3) != 2)
660 if (dsp_row != NULL && (png_ptr->row_number & 2))
662 png_pass_dsp_mask[png_ptr->pass]);
668 if ((png_ptr->row_number & 1) || png_ptr->width < 2)
672 png_pass_dsp_mask[png_ptr->pass]);
678 if (!(png_ptr->row_number & 1))
689 png_error(png_ptr,
"Invalid attempt to read row data");
691 png_ptr->zstream.next_out = png_ptr->row_buf;
692 png_ptr->zstream.avail_out = (
uInt)png_ptr->irowbytes;
695 if (!(png_ptr->zstream.avail_in))
697 while (!png_ptr->idat_size)
702 if (
png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
703 png_error(png_ptr,
"Not enough image data");
705 png_ptr->zstream.avail_in = (
uInt)png_ptr->zbuf_size;
706 png_ptr->zstream.next_in = png_ptr->zbuf;
707 if (png_ptr->zbuf_size > png_ptr->idat_size)
708 png_ptr->zstream.avail_in = (
uInt)png_ptr->idat_size;
711 png_ptr->idat_size -= png_ptr->zstream.avail_in;
716 if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in ||
718 png_error(png_ptr,
"Extra compressed data");
720 png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
724 png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg :
725 "Decompression error");
727 }
while (png_ptr->zstream.avail_out);
729 png_ptr->row_info.color_type = png_ptr->color_type;
730 png_ptr->row_info.width = png_ptr->iwidth;
731 png_ptr->row_info.channels = png_ptr->channels;
732 png_ptr->row_info.bit_depth = png_ptr->bit_depth;
733 png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
734 png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
735 png_ptr->row_info.width);
737 if (png_ptr->row_buf[0])
739 png_ptr->row_buf + 1, png_ptr->prev_row + 1,
740 (
int)(png_ptr->row_buf[0]));
743 png_ptr->rowbytes + 1);
745 #if defined(PNG_MNG_FEATURES_SUPPORTED) 755 if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA))
758 #if defined(PNG_READ_INTERLACING_SUPPORTED) 760 if (png_ptr->interlaced &&
761 (png_ptr->transformations & PNG_INTERLACE))
763 if (png_ptr->pass < 6)
787 if (png_ptr->read_row_fn != NULL)
788 (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
792 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 826 if (png_ptr == NULL)
return;
829 if (rp != NULL && dp != NULL)
854 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 875 if (png_ptr == NULL)
return;
877 #ifdef PNG_READ_INTERLACING_SUPPORTED 880 if (png_ptr->interlaced)
882 "Cannot read interlaced image -- interlace handler disabled.");
887 image_height=png_ptr->height;
890 for (j = 0; j < pass; j++)
902 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 911 if (png_ptr == NULL)
return;
916 #ifdef PNG_USE_LOCAL_ARRAYS 921 #if defined(PNG_READ_bKGD_SUPPORTED) 924 #if defined(PNG_READ_cHRM_SUPPORTED) 927 #if defined(PNG_READ_gAMA_SUPPORTED) 930 #if defined(PNG_READ_hIST_SUPPORTED) 933 #if defined(PNG_READ_iCCP_SUPPORTED) 936 #if defined(PNG_READ_iTXt_SUPPORTED) 939 #if defined(PNG_READ_oFFs_SUPPORTED) 942 #if defined(PNG_READ_pCAL_SUPPORTED) 945 #if defined(PNG_READ_pHYs_SUPPORTED) 948 #if defined(PNG_READ_sBIT_SUPPORTED) 951 #if defined(PNG_READ_sCAL_SUPPORTED) 954 #if defined(PNG_READ_sPLT_SUPPORTED) 957 #if defined(PNG_READ_sRGB_SUPPORTED) 960 #if defined(PNG_READ_tEXt_SUPPORTED) 963 #if defined(PNG_READ_tIME_SUPPORTED) 966 #if defined(PNG_READ_tRNS_SUPPORTED) 969 #if defined(PNG_READ_zTXt_SUPPORTED) 978 else if (!
png_memcmp(chunk_name, png_IEND, 4))
980 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 985 if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
986 png_error(png_ptr,
"Too many IDAT's found");
993 else if (!
png_memcmp(chunk_name, png_IDAT, 4))
998 if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
999 png_error(png_ptr,
"Too many IDAT's found");
1002 else if (!
png_memcmp(chunk_name, png_PLTE, 4))
1004 #if defined(PNG_READ_bKGD_SUPPORTED) 1005 else if (!
png_memcmp(chunk_name, png_bKGD, 4))
1008 #if defined(PNG_READ_cHRM_SUPPORTED) 1009 else if (!
png_memcmp(chunk_name, png_cHRM, 4))
1012 #if defined(PNG_READ_gAMA_SUPPORTED) 1013 else if (!
png_memcmp(chunk_name, png_gAMA, 4))
1016 #if defined(PNG_READ_hIST_SUPPORTED) 1017 else if (!
png_memcmp(chunk_name, png_hIST, 4))
1020 #if defined(PNG_READ_oFFs_SUPPORTED) 1021 else if (!
png_memcmp(chunk_name, png_oFFs, 4))
1024 #if defined(PNG_READ_pCAL_SUPPORTED) 1025 else if (!
png_memcmp(chunk_name, png_pCAL, 4))
1028 #if defined(PNG_READ_sCAL_SUPPORTED) 1029 else if (!
png_memcmp(chunk_name, png_sCAL, 4))
1032 #if defined(PNG_READ_pHYs_SUPPORTED) 1033 else if (!
png_memcmp(chunk_name, png_pHYs, 4))
1036 #if defined(PNG_READ_sBIT_SUPPORTED) 1037 else if (!
png_memcmp(chunk_name, png_sBIT, 4))
1040 #if defined(PNG_READ_sRGB_SUPPORTED) 1041 else if (!
png_memcmp(chunk_name, png_sRGB, 4))
1044 #if defined(PNG_READ_iCCP_SUPPORTED) 1045 else if (!
png_memcmp(chunk_name, png_iCCP, 4))
1048 #if defined(PNG_READ_sPLT_SUPPORTED) 1049 else if (!
png_memcmp(chunk_name, png_sPLT, 4))
1052 #if defined(PNG_READ_tEXt_SUPPORTED) 1053 else if (!
png_memcmp(chunk_name, png_tEXt, 4))
1056 #if defined(PNG_READ_tIME_SUPPORTED) 1057 else if (!
png_memcmp(chunk_name, png_tIME, 4))
1060 #if defined(PNG_READ_tRNS_SUPPORTED) 1061 else if (!
png_memcmp(chunk_name, png_tRNS, 4))
1064 #if defined(PNG_READ_zTXt_SUPPORTED) 1065 else if (!
png_memcmp(chunk_name, png_zTXt, 4))
1068 #if defined(PNG_READ_iTXt_SUPPORTED) 1069 else if (!
png_memcmp(chunk_name, png_iTXt, 4))
1070 png_handle_iTXt(png_ptr, info_ptr, length);
1085 #ifdef PNG_USER_MEM_SUPPORTED 1090 png_debug(1,
"in png_destroy_read_struct\n");
1091 if (png_ptr_ptr != NULL)
1092 png_ptr = *png_ptr_ptr;
1093 if (png_ptr == NULL)
1096 #ifdef PNG_USER_MEM_SUPPORTED 1097 free_fn = png_ptr->free_fn;
1098 mem_ptr = png_ptr->mem_ptr;
1101 if (info_ptr_ptr != NULL)
1104 if (end_info_ptr_ptr != NULL)
1109 if (info_ptr != NULL)
1111 #if defined(PNG_TEXT_SUPPORTED) 1115 #ifdef PNG_USER_MEM_SUPPORTED 1121 *info_ptr_ptr = NULL;
1124 if (end_info_ptr != NULL)
1126 #if defined(PNG_READ_TEXT_SUPPORTED) 1129 #ifdef PNG_USER_MEM_SUPPORTED 1135 *end_info_ptr_ptr = NULL;
1138 if (png_ptr != NULL)
1140 #ifdef PNG_USER_MEM_SUPPORTED 1146 *png_ptr_ptr = NULL;
1154 #ifdef PNG_SETJMP_SUPPORTED 1160 #ifdef PNG_USER_MEM_SUPPORTED 1165 if (info_ptr != NULL)
1168 if (end_info_ptr != NULL)
1172 png_free(png_ptr, png_ptr->big_row_buf);
1173 png_free(png_ptr, png_ptr->prev_row);
1174 png_free(png_ptr, png_ptr->chunkdata);
1175 #if defined(PNG_READ_DITHER_SUPPORTED) 1176 png_free(png_ptr, png_ptr->palette_lookup);
1177 png_free(png_ptr, png_ptr->dither_index);
1179 #if defined(PNG_READ_GAMMA_SUPPORTED) 1180 png_free(png_ptr, png_ptr->gamma_table);
1182 #if defined(PNG_READ_BACKGROUND_SUPPORTED) 1183 png_free(png_ptr, png_ptr->gamma_from_1);
1184 png_free(png_ptr, png_ptr->gamma_to_1);
1186 #ifdef PNG_FREE_ME_SUPPORTED 1191 if (png_ptr->flags & PNG_FLAG_FREE_PLTE)
1193 png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
1195 #if defined(PNG_tRNS_SUPPORTED) || \ 1196 defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) 1197 #ifdef PNG_FREE_ME_SUPPORTED 1202 if (png_ptr->flags & PNG_FLAG_FREE_TRNS)
1204 png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
1207 #if defined(PNG_READ_hIST_SUPPORTED) 1208 #ifdef PNG_FREE_ME_SUPPORTED 1213 if (png_ptr->flags & PNG_FLAG_FREE_HIST)
1215 png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
1218 #if defined(PNG_READ_GAMMA_SUPPORTED) 1219 if (png_ptr->gamma_16_table != NULL)
1222 int istop = (1 << (8 - png_ptr->gamma_shift));
1223 for (i = 0; i < istop; i++)
1225 png_free(png_ptr, png_ptr->gamma_16_table[i]);
1227 png_free(png_ptr, png_ptr->gamma_16_table);
1229 #if defined(PNG_READ_BACKGROUND_SUPPORTED) 1230 if (png_ptr->gamma_16_from_1 != NULL)
1233 int istop = (1 << (8 - png_ptr->gamma_shift));
1234 for (i = 0; i < istop; i++)
1236 png_free(png_ptr, png_ptr->gamma_16_from_1[i]);
1238 png_free(png_ptr, png_ptr->gamma_16_from_1);
1240 if (png_ptr->gamma_16_to_1 != NULL)
1243 int istop = (1 << (8 - png_ptr->gamma_shift));
1244 for (i = 0; i < istop; i++)
1246 png_free(png_ptr, png_ptr->gamma_16_to_1[i]);
1248 png_free(png_ptr, png_ptr->gamma_16_to_1);
1252 #if defined(PNG_TIME_RFC1123_SUPPORTED) 1253 png_free(png_ptr, png_ptr->time_buffer);
1257 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED 1258 png_free(png_ptr, png_ptr->save_buffer);
1261 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED 1262 #ifdef PNG_TEXT_SUPPORTED 1263 png_free(png_ptr, png_ptr->current_text);
1270 #ifdef PNG_SETJMP_SUPPORTED 1274 error_fn = png_ptr->error_fn;
1275 warning_fn = png_ptr->warning_fn;
1276 error_ptr = png_ptr->error_ptr;
1277 #ifdef PNG_USER_MEM_SUPPORTED 1278 free_fn = png_ptr->free_fn;
1286 #ifdef PNG_USER_MEM_SUPPORTED 1290 #ifdef PNG_SETJMP_SUPPORTED 1299 if (png_ptr == NULL)
return;
1304 #ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED 1305 #if defined(PNG_INFO_IMAGE_SUPPORTED) 1313 if (png_ptr == NULL)
return;
1314 #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) 1326 png_error(png_ptr,
"Image is too high to process with png_read_png()");
1330 #if defined(PNG_READ_16_TO_8_SUPPORTED) 1337 #if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) 1345 #if defined(PNG_READ_PACK_SUPPORTED) && !defined(PNG_READ_EXPAND_SUPPORTED) 1353 #if defined(PNG_READ_PACKSWAP_SUPPORTED) 1361 #if defined(PNG_READ_EXPAND_SUPPORTED) 1368 if ((png_ptr->bit_depth < 8) ||
1377 #if defined(PNG_READ_INVERT_SUPPORTED) 1384 #if defined(PNG_READ_SHIFT_SUPPORTED) 1399 #if defined(PNG_READ_BGR_SUPPORTED) 1406 #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) 1413 #if defined(PNG_READ_SWAP_SUPPORTED) 1430 #ifdef PNG_FREE_ME_SUPPORTED 1433 if (info_ptr->row_pointers == NULL)
1437 #ifdef PNG_FREE_ME_SUPPORTED 1440 for (row = 0; row < (
int)info_ptr->height; row++)
void png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
void PNGAPI png_set_packing(png_structp png_ptr)
PNG_CONST char png_libpng_ver[18]
#define PNG_USER_WIDTH_MAX
#define PNG_TRANSFORM_SWAP_ENDIAN
png_voidp png_error_ptr png_error_ptr png_voidp png_malloc_ptr malloc_fn
void png_zfree(voidpf png_ptr, voidpf ptr)
void PNGAPI png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
#define PNG_TRANSFORM_STRIP_16
png_voidp png_create_struct(int type)
void png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void PNGAPI png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn)
#define PNG_TRANSFORM_INVERT_MONO
png_voidp png_error_ptr png_error_ptr png_voidp png_malloc_ptr png_free_ptr free_fn
png_uint_32 PNGAPI png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
void PNGAPI png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)
#define png_malloc_ptr_NULL
void PNGAPI png_set_invert_alpha(png_structp png_ptr)
#define PNG_TRANSFORM_PACKSWAP
#define PNG_COLOR_TYPE_PALETTE
void png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void PNGAPI png_read_rows(png_structp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)
png_size_t png_size_t num_to_check
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
png_infop png_charp png_int_32 png_int_32 int int png_charp png_charpp * params
#define PNG_TRANSFORM_BGR
void png_do_read_transformations(png_structp png_ptr)
int PNGAPI png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
PNG_CONST char FAR * png_const_charp
void PNGAPI png_set_strip_16(png_structp png_ptr)
void png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length)
png_infopp png_infopp end_info_ptr_ptr
#define PNG_USER_HEIGHT_MAX
void png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr)
void png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_voidp png_error_ptr png_error_ptr warning_fn
png_bytep png_bytep png_size_t length
png_struct FAR *FAR * png_structpp
void png_read_finish_row(png_structp png_ptr)
voidpf png_zalloc(voidpf png_ptr, uInt items, uInt size)
void png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void PNGAPI png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
void PNGAPI png_set_bgr(png_structp png_ptr)
png_byte FAR *FAR * png_bytepp
void png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_bytepp png_bytepp display_row
void png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_uint_32 PNGAPI png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
void png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
png_struct FAR * png_structp
void png_read_start_row(png_structp png_ptr)
void PNGAPI png_read_end(png_structp png_ptr, png_infop info_ptr)
png_read_status_ptr read_row_fn
void png_info_destroy(png_structp png_ptr, png_infop info_ptr)
void PNGAPI png_error(png_structp png_ptr, png_const_charp error_message)
int JSAMPARRAY int int num_rows
void PNGAPI png_set_packswap(png_structp png_ptr)
void png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void png_destroy_struct(png_voidp struct_ptr)
void PNGAPI png_set_swap(png_structp png_ptr)
png_voidp png_error_ptr error_fn
void png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void png_do_read_interlace(png_structp png_ptr)
void PNGAPI png_warning(png_structp png_ptr, png_const_charp warning_message)
void png_combine_row(png_structp png_ptr, png_bytep row, int mask)
PNG_CONST int FARDATA png_pass_dsp_mask[]
void png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
int PNGAPI png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
#define PNG_TRANSFORM_PACKING
#define PNG_TRANSFORM_INVERT_ALPHA
void PNGAPI png_set_strip_alpha(png_structp png_ptr)
int png_crc_finish(png_structp png_ptr, png_uint_32 skip)
void PNGAPI png_read_info(png_structp png_ptr, png_infop info_ptr)
void PNGAPI png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)
void PNGAPI png_set_invert_mono(png_structp png_ptr)
void PNGAPI png_start_read_image(png_structp png_ptr)
void PNGAPI png_read_init(png_structp png_ptr)
#define PNG_FLAG_MNG_FILTER_64
void png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_structp PNGAPI png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)
png_voidp png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
PNG_CONST int FARDATA png_pass_mask[]
void png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter)
#define png_free_ptr_NULL
png_structp PNGAPI png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)
png_voidp png_error_ptr png_error_ptr warn_fn
png_voidp PNGAPI png_memcpy_check(png_structp png_ptr, png_voidp s1, png_voidp s2, png_uint_32 length)
void PNGAPI png_set_expand(png_structp png_ptr)
png_color_8 FAR * png_color_8p
void png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
int PNGAPI png_set_interlace_handling(png_structp png_ptr)
void png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void PNGAPI png_read_png(png_structp png_ptr, png_infop info_ptr, int transforms, voidp params)
#define inflateInit(strm)
void PNGAPI png_set_shift(png_structp png_ptr, png_color_8p true_bits)
#define PNG_TRANSFORM_SWAP_ALPHA
void png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, png_voidp mem_ptr)
void PNGAPI png_read_image(png_structp png_ptr, png_bytepp image)
void png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
#define PNG_TRANSFORM_EXPAND
#define PNG_INTRAPIXEL_DIFFERENCING
int ZEXPORT inflate(z_streamp strm, int flush)
void png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
#define PNG_TRANSFORM_STRIP_ALPHA
unsigned long png_uint_32
void PNGAPI png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t png_info_size)
void png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_voidp png_error_ptr png_error_ptr png_voidp mem_ptr
png_info FAR *FAR * png_infopp
void PNGAPI png_free(png_structp png_ptr, png_voidp ptr)
#define png_debug2(l, m, p1, p2)
png_uint_32 PNGAPI png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
void PNGAPI png_set_swap_alpha(png_structp png_ptr)
void PNGAPI png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)
#define PNG_TRANSFORM_SHIFT
void PNGAPI png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, png_size_t png_struct_size)
void png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void PNGAPI png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)
void PNGAPI png_read_update_info(png_structp png_ptr, png_infop info_ptr)
int ZEXPORT inflateEnd(z_streamp strm)
png_voidp PNGAPI png_malloc(png_structp png_ptr, png_uint_32 size)
png_uint_32 png_read_chunk_header(png_structp png_ptr)
png_infop png_color_8p * sig_bit