Binary files libpng-1.2.24/contrib/gregbook/toucan.png and libpng-1.2.25beta02/contrib/gregbook/toucan.png differ diff -ru4N libpng-1.2.24/png.h libpng-1.2.25beta02/png.h --- libpng-1.2.24/png.h Fri Dec 14 10:22:29 2007 +++ libpng-1.2.25beta02/png.h Wed Jan 9 23:01:58 2008 @@ -1,9 +1,9 @@ /* png.h - header file for PNG reference library * * libpng version %VER% - %DATE% - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 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.) * * Authors and maintainers: @@ -174,8 +174,9 @@ * 1.2.23 13 10223 12.so.0.23[.0] * 1.2.24beta01-02 13 10224 12.so.0.24[.0] * 1.2.24rc01 13 10224 12.so.0.24[.0] * 1.2.24 13 10224 12.so.0.24[.0] + * 1.2.25beta01-02 13 10225 12.so.0.25[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The @@ -204,9 +205,9 @@ * If you modify libpng you may insert additional notices immediately following * this sentence. * * libpng versions 1.2.6, August 15, 2004, through %VER%, %DATE%, are - * Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are + * Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: * * Cosmin Truta diff -ru4N libpng-1.2.24/pngconf.h libpng-1.2.25beta02/pngconf.h --- libpng-1.2.24/pngconf.h Fri Dec 14 10:22:29 2007 +++ libpng-1.2.25beta02/pngconf.h Wed Jan 9 23:01:58 2008 @@ -2,9 +2,9 @@ /* pngconf.h - machine configurable file for libpng * * libpng version %VER% - %DATE% * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 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.) */ diff -ru4N libpng-1.2.24/pngpread.c libpng-1.2.25beta02/pngpread.c --- libpng-1.2.24/pngpread.c Fri Dec 14 10:22:30 2007 +++ libpng-1.2.25beta02/pngpread.c Wed Jan 9 23:01:58 2008 @@ -1,10 +1,10 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.2.23 [November 6, 2007] + * Last changed in libpng 1.2.25 [%DATE%] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 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.) */ @@ -1516,11 +1516,11 @@ png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); } } -#else - png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); + else #endif + png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); png_free(png_ptr, png_ptr->unknown_chunk.data); png_ptr->unknown_chunk.data = NULL; } else diff -ru4N libpng-1.2.24/pngrtran.c libpng-1.2.25beta02/pngrtran.c --- libpng-1.2.24/pngrtran.c Fri Dec 14 10:22:31 2007 +++ libpng-1.2.25beta02/pngrtran.c Wed Jan 9 23:01:58 2008 @@ -1,10 +1,10 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.2.22 [October 13, 2007] + * Last changed in libpng 1.2.25 [%DATE%] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 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.) * * This file contains functions optionally called by an application @@ -963,8 +963,16 @@ palette[i].green = png_ptr->gamma_table[palette[i].green]; palette[i].blue = png_ptr->gamma_table[palette[i].blue]; } } + /* Prevent the transformations being done again, and make sure + * that the now spurious alpha channel is stripped - the code + * has just reduced background composition and gamma correction + * to a simply alpha channel strip. + */ + png_ptr->transformations &= ~PNG_BACKGROUND; + png_ptr->transformations &= ~PNG_GAMMA; + png_ptr->transformations |= PNG_STRIP_ALPHA; } /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */ else /* color_type != PNG_COLOR_TYPE_PALETTE */ @@ -1037,8 +1045,11 @@ palette[i].red = png_ptr->gamma_table[palette[i].red]; palette[i].green = png_ptr->gamma_table[palette[i].green]; palette[i].blue = png_ptr->gamma_table[palette[i].blue]; } + + /* Done the gamma correction. */ + png_ptr->transformations &= ~PNG_GAMMA; } } #if defined(PNG_READ_BACKGROUND_SUPPORTED) else @@ -1074,8 +1085,12 @@ png_composite(palette[i].blue, palette[i].blue, png_ptr->trans[i], back.blue); } } + + /* Handled alpha, still need to strip the channel. */ + png_ptr->transformations &= ~PNG_BACKGROUND; + png_ptr->transformations |= PNG_STRIP_ALPHA; } #endif /* PNG_READ_BACKGROUND_SUPPORTED */ #if defined(PNG_READ_SHIFT_SUPPORTED) diff -ru4N libpng-1.2.24/pngrutil.c libpng-1.2.25beta02/pngrutil.c --- libpng-1.2.24/pngrutil.c Fri Dec 14 10:22:31 2007 +++ libpng-1.2.25beta02/pngrutil.c Wed Jan 9 23:01:58 2008 @@ -1,10 +1,10 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.2.23 [November 6, 2007] + * Last changed in libpng 1.2.25 [%DATE%] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 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.) * * This file contains routines that are only called from within @@ -2248,11 +2248,11 @@ png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); } } -#else - png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); + else #endif + png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); png_free(png_ptr, png_ptr->unknown_chunk.data); png_ptr->unknown_chunk.data = NULL; } else