| OLD | NEW |
| 1 | 1 |
| 2 /* pngwrite.c - general routines to write a PNG file | 2 /* pngwrite.c - general routines to write a PNG file |
| 3 * | 3 * |
| 4 * Last changed in libpng 1.2.42 [January 3, 2010] | 4 * Last changed in libpng 1.2.45 [July 7, 2011] |
| 5 * Copyright (c) 1998-2010 Glenn Randers-Pehrson | 5 * Copyright (c) 1998-2011 Glenn Randers-Pehrson |
| 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) | 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
| 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) | 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
| 8 * | 8 * |
| 9 * This code is released under the libpng license. | 9 * This code is released under the libpng license. |
| 10 * For conditions of distribution and use, see the disclaimer | 10 * For conditions of distribution and use, see the disclaimer |
| 11 * and license in png.h | 11 * and license in png.h |
| 12 */ | 12 */ |
| 13 | 13 |
| 14 /* Get internal access to png.h */ | 14 /* Get internal access to png.h */ |
| 15 #define PNG_INTERNAL | 15 #define PNG_INTERNAL |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 png_debug(5, "writing extra chunks"); | 288 png_debug(5, "writing extra chunks"); |
| 289 | 289 |
| 290 for (up = info_ptr->unknown_chunks; | 290 for (up = info_ptr->unknown_chunks; |
| 291 up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; | 291 up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; |
| 292 up++) | 292 up++) |
| 293 { | 293 { |
| 294 int keep = png_handle_as_unknown(png_ptr, up->name); | 294 int keep = png_handle_as_unknown(png_ptr, up->name); |
| 295 if (keep != PNG_HANDLE_CHUNK_NEVER && | 295 if (keep != PNG_HANDLE_CHUNK_NEVER && |
| 296 up->location && (up->location & PNG_HAVE_PLTE) && | 296 up->location && (up->location & PNG_HAVE_PLTE) && |
| 297 !(up->location & PNG_HAVE_IDAT) && | 297 !(up->location & PNG_HAVE_IDAT) && |
| 298 !(up->location & PNG_AFTER_IDAT) && |
| 298 ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || | 299 ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || |
| 299 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) | 300 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) |
| 300 { | 301 { |
| 301 png_write_chunk(png_ptr, up->name, up->data, up->size); | 302 png_write_chunk(png_ptr, up->name, up->data, up->size); |
| 302 } | 303 } |
| 303 } | 304 } |
| 304 } | 305 } |
| 305 #endif | 306 #endif |
| 306 } | 307 } |
| 307 | 308 |
| (...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1583 png_write_image(png_ptr, info_ptr->row_pointers); | 1584 png_write_image(png_ptr, info_ptr->row_pointers); |
| 1584 | 1585 |
| 1585 /* It is REQUIRED to call this to finish writing the rest of the file */ | 1586 /* It is REQUIRED to call this to finish writing the rest of the file */ |
| 1586 png_write_end(png_ptr, info_ptr); | 1587 png_write_end(png_ptr, info_ptr); |
| 1587 | 1588 |
| 1588 transforms = transforms; /* Quiet compiler warnings */ | 1589 transforms = transforms; /* Quiet compiler warnings */ |
| 1589 params = params; | 1590 params = params; |
| 1590 } | 1591 } |
| 1591 #endif | 1592 #endif |
| 1592 #endif /* PNG_WRITE_SUPPORTED */ | 1593 #endif /* PNG_WRITE_SUPPORTED */ |
| OLD | NEW |