diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2012-09-27 06:21:28 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2012-09-27 18:59:32 -0500 |
commit | c2ac10b502f9cdf932d13a15e98d8810477180a1 (patch) | |
tree | db245e03ce5586f85fa5a7451e60e64eac0ee77d /pngwtran.c | |
parent | c86cf4b7e40a3baf17b8e6ab2526b63e71d28700 (diff) | |
download | libpng-c2ac10b502f9cdf932d13a15e98d8810477180a1.tar.gz |
[master] Imported from libpng-1.5.13.tar
Diffstat (limited to 'pngwtran.c')
-rw-r--r-- | pngwtran.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pngwtran.c b/pngwtran.c index 96608efcb..743581327 100644 --- a/pngwtran.c +++ b/pngwtran.c @@ -1,8 +1,8 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.5.6 [November 3, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.13 [September 27, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -45,8 +45,20 @@ png_do_write_transformations(png_structp png_ptr, png_row_infop row_info) #ifdef PNG_WRITE_FILLER_SUPPORTED if (png_ptr->transformations & PNG_FILLER) - png_do_strip_channel(row_info, png_ptr->row_buf + 1, - !(png_ptr->flags & PNG_FLAG_FILLER_AFTER)); + { + if (png_ptr->color_type & (PNG_COLOR_MASK_ALPHA|PNG_COLOR_MASK_PALETTE)) + { + /* GA, RGBA or palette; in any of these cases libpng will not do the + * the correct thing (whatever that might be). + */ + png_warning(png_ptr, "incorrect png_set_filler call ignored"); + png_ptr->transformations &= ~PNG_FILLER; + } + + else + png_do_strip_channel(row_info, png_ptr->row_buf + 1, + !(png_ptr->flags & PNG_FLAG_FILLER_AFTER)); + } #endif #ifdef PNG_WRITE_PACKSWAP_SUPPORTED |