diff --git a/CMakeLists.txt b/CMakeLists.txt index ac1e9c543..30f74573d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,7 +262,7 @@ endif(NOT WIN32 OR CYGWIN OR MINGW) # SET UP LINKS if(PNG_SHARED) set_target_properties(${PNG_LIB_NAME} PROPERTIES -# VERSION 16.${PNGLIB_RELEASE}.1.6.0beta05 +# VERSION 16.${PNGLIB_RELEASE}.1.6.0beta06 VERSION 16.${PNGLIB_RELEASE}.0 SOVERSION 16 CLEAN_DIRECT_OUTPUT 1) diff --git a/LICENSE b/LICENSE index 04b248241..355eef4ba 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.6.0beta05, January 15, 2012, are +libpng versions 1.2.6, August 15, 2004, through 1.6.0beta06, January 16, 2012, are Copyright (c) 2004, 2006-2011 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 @@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -January 15, 2012 +January 16, 2012 diff --git a/README b/README index 182c6d5af..7875b15bb 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.0beta05 - January 15, 2012 (shared library 16.0) +README for libpng version 1.6.0beta06 - January 16, 2012 (shared library 16.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/configure.ac b/configure.ac index a4b5c9172..e79c37352 100644 --- a/configure.ac +++ b/configure.ac @@ -18,12 +18,12 @@ AC_PREREQ(2.59) dnl Version number stuff here: -AC_INIT([libpng], [1.6.0beta05], [png-mng-implement@lists.sourceforge.net]) +AC_INIT([libpng], [1.6.0beta06], [png-mng-implement@lists.sourceforge.net]) AM_INIT_AUTOMAKE dnl stop configure from automagically running automake AM_MAINTAINER_MODE -PNGLIB_VERSION=1.6.0beta05 +PNGLIB_VERSION=1.6.0beta06 PNGLIB_MAJOR=1 PNGLIB_MINOR=6 PNGLIB_RELEASE=0 diff --git a/contrib/libtests/pngstest.c b/contrib/libtests/pngstest.c index 6e17b2022..c0b2cd503 100644 --- a/contrib/libtests/pngstest.c +++ b/contrib/libtests/pngstest.c @@ -127,7 +127,8 @@ print_opts(png_uint_32 opts) /* A name table for all the formats - defines the format of the '+' arguments to * pngstest. */ -static PNG_CONST char * PNG_CONST format_names[32] = +#define FORMAT_COUNT 64 +static PNG_CONST char * PNG_CONST format_names[FORMAT_COUNT] = { "sRGB-gray", "sRGB-gray+alpha", @@ -137,6 +138,16 @@ static PNG_CONST char * PNG_CONST format_names[32] = "linear-gray+alpha", "linear-rgb", "linear-rgb+alpha", + + "color-mapped-sRGB-gray", + "color-mapped-sRGB-gray+alpha", + "color-mapped-sRGB-rgb", + "color-mapped-sRGB-rgb+alpha", + "color-mapped-linear-gray", + "color-mapped-linear-gray+alpha", + "color-mapped-linear-rgb", + "color-mapped-linear-rgb+alpha", + "sRGB-gray", "sRGB-gray+alpha", "sRGB-bgr", @@ -145,6 +156,16 @@ static PNG_CONST char * PNG_CONST format_names[32] = "linear-gray+alpha", "linear-bgr", "linear-bgr+alpha", + + "color-mapped-sRGB-gray", + "color-mapped-sRGB-gray+alpha", + "color-mapped-sRGB-bgr", + "color-mapped-sRGB-bgr+alpha", + "color-mapped-linear-gray", + "color-mapped-linear-gray+alpha", + "color-mapped-linear-bgr", + "color-mapped-linear-bgr+alpha", + "sRGB-gray", "alpha+sRGB-gray", "sRGB-rgb", @@ -153,6 +174,16 @@ static PNG_CONST char * PNG_CONST format_names[32] = "alpha+linear-gray", "linear-rgb", "alpha+linear-rgb", + + "color-mapped-sRGB-gray", + "color-mapped-alpha+sRGB-gray", + "color-mapped-sRGB-rgb", + "color-mapped-alpha+sRGB-rgb", + "color-mapped-linear-gray", + "color-mapped-alpha+linear-gray", + "color-mapped-linear-rgb", + "color-mapped-alpha+linear-rgb", + "sRGB-gray", "alpha+sRGB-gray", "sRGB-bgr", @@ -161,6 +192,15 @@ static PNG_CONST char * PNG_CONST format_names[32] = "alpha+linear-gray", "linear-bgr", "alpha+linear-bgr", + + "color-mapped-sRGB-gray", + "color-mapped-alpha+sRGB-gray", + "color-mapped-sRGB-bgr", + "color-mapped-alpha+sRGB-bgr", + "color-mapped-linear-gray", + "color-mapped-alpha+linear-gray", + "color-mapped-linear-bgr", + "color-mapped-alpha+linear-bgr", }; /* Decode an argument to a format number. */ @@ -170,17 +210,73 @@ formatof(const char *arg) char *ep; unsigned long format = strtoul(arg, &ep, 0); - if (ep > arg && *ep == 0 && format < 32) + if (ep > arg && *ep == 0 && format < FORMAT_COUNT) return (png_uint_32)format; - else for (format=0; format < 32; ++format) + else for (format=0; format < FORMAT_COUNT; ++format) { if (strcmp(format_names[format], arg) == 0) return (png_uint_32)format; } fprintf(stderr, "pngstest: format name '%s' invalid\n", arg); - return 32; + return FORMAT_COUNT; +} + +/* Bitset/test functions for formats */ +#define FORMAT_SET_COUNT (FORMAT_COUNT / 32) +typedef struct +{ + png_uint_32 bits[FORMAT_SET_COUNT]; +} +format_list; + +static void format_init(format_list *pf) +{ + int i; + for (i=0; ibits[i] = ~(png_uint_32)0; +} + +static void format_clear(format_list *pf) +{ + int i; + for (i=0; ibits[i] = 0; +} + +static int format_is_initial(format_list *pf) +{ + int i; + for (i=0; ibits[i] != ~(png_uint_32)0) + return 0; + + return 1; +} + +static int format_set(format_list *pf, png_uint_32 format) +{ + if (format < FORMAT_COUNT) + return pf->bits[format >> 5] |= ((png_uint_32)1) << (format & 31); + + return 0; +} + +#if 0 /* currently unused */ +static int format_unset(format_list *pf, png_uint_32 format) +{ + if (format < FORMAT_COUNT) + return pf->bits[format >> 5] &= ~((png_uint_32)1) << (format & 31); + + return 0; +} +#endif + +static int format_isset(format_list *pf, png_uint_32 format) +{ + return format < FORMAT_COUNT && + (pf->bits[format >> 5] & (((png_uint_32)1) << (format & 31))) != 0; } /* THE Image STRUCTURE */ @@ -193,6 +289,7 @@ typedef struct png_uint_32 opts; const char *file_name; int stride_extra; + int cmap_size; FILE *input_file; png_voidp input_memory; png_size_t input_memory_size; @@ -202,6 +299,7 @@ typedef struct png_size_t allocsize; png_color background; char tmpfile_name[32]; + png_byte colormap[256*4*2]; } Image; @@ -403,6 +501,8 @@ typedef struct * 65535/255. Color images have a correctly calculated Y value using the sRGB Y * calculation. * + * Colors are looked up in the color map if required. + * * The API returns false if an error is detected; this can only be if the alpha * value is less than the component in the linear case. */ @@ -412,17 +512,25 @@ get_pixel(Image *image, Pixel *pixel, png_const_bytep pp) png_uint_32 format = image->image.format; int result = 1; - pixel->format = format; + if (format & PNG_FORMAT_FLAG_COLORMAP) + { + /* The actual sample is in the color-map, indexed by the pixel */ + pixel->format = PNG_FORMAT_OF_COLORMAP(format); + pp = image->colormap + PNG_IMAGE_SAMPLE_SIZE(format) * *pp; + } + + else + pixel->format = format; /* Initialize the alpha values for opaque: */ pixel->a8 = 255; pixel->a16 = 65535; - switch (PNG_IMAGE_COMPONENT_SIZE(format)) + switch (PNG_IMAGE_SAMPLE_COMPONENT_SIZE(format)) { default: - fprintf(stderr, "pngstest: impossible component size: %lu\n", - (unsigned long)PNG_IMAGE_COMPONENT_SIZE(format)); + fprintf(stderr, "pngstest: impossible sample component size: %lu\n", + (unsigned long)PNG_IMAGE_SAMPLE_COMPONENT_SIZE(format)); exit(1); case sizeof (png_uint_16): @@ -1485,7 +1593,7 @@ write_one_file(Image *output, Image *image, int convert_to_8bit) } static int -testimage(Image *image, png_uint_32 opts, png_uint_32 formats) +testimage(Image *image, png_uint_32 opts, format_list *pf) { int result; Image copy; @@ -1511,7 +1619,12 @@ testimage(Image *image, png_uint_32 opts, png_uint_32 formats) newimage(&output); result = 1; - for (format=0; format<32; ++format) if (formats & (1< 31) + if (format > FORMAT_COUNT) exit(1); - if (formats == (png_uint_32)~0) - formats = 0; + if (format_is_initial(&formats)) + format_clear(&formats); - formats |= 1< Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.0beta05 - January 15, 2012 + libpng versions 0.97, January 1998, through 1.6.0beta06 - January 16, 2012 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -4905,13 +4905,13 @@ Other rules can be inferred by inspecting the libpng source. XVI. Y2K Compliance in libpng -January 15, 2012 +January 16, 2012 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.6.0beta05 are Y2K compliant. It is my belief that earlier +upward through 1.6.0beta06 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer that diff --git a/libpng.3 b/libpng.3 index 6c5a65a72..f3515a060 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,6 +1,6 @@ -.TH LIBPNG 3 "January 15, 2012" +.TH LIBPNG 3 "January 16, 2012" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.0beta05 +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.0beta06 .SH SYNOPSIS \fI\fB @@ -1003,7 +1003,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.0beta05 - January 15, 2012 + libpng version 1.6.0beta06 - January 16, 2012 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -1014,7 +1014,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.0beta05 - January 15, 2012 + libpng versions 0.97, January 1998, through 1.6.0beta06 - January 16, 2012 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -5909,13 +5909,13 @@ Other rules can be inferred by inspecting the libpng source. .SH XVI. Y2K Compliance in libpng -January 15, 2012 +January 16, 2012 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.6.0beta05 are Y2K compliant. It is my belief that earlier +upward through 1.6.0beta06 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer that @@ -6120,7 +6120,7 @@ the first widely used release: 1.5.7beta01-05 15 10507 15.so.15.7[.0] 1.5.7rc01-03 15 10507 15.so.15.7[.0] 1.5.7 15 10507 15.so.15.7[.0] - 1.6.0beta01-05 16 10600 16.so.16.0[.0] + 1.6.0beta01-06 16 10600 16.so.16.0[.0] Henceforth the source version will match the shared-library minor and patch numbers; the shared-library major version number will be @@ -6177,7 +6177,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.6.0beta05 - January 15, 2012: +Libpng version 1.6.0beta06 - January 16, 2012: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -6200,7 +6200,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.6.0beta05, January 15, 2012, are +libpng versions 1.2.6, August 15, 2004, through 1.6.0beta06, January 16, 2012, are Copyright (c) 2004,2006-2007 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 @@ -6299,7 +6299,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -January 15, 2012 +January 16, 2012 .\" end of man page diff --git a/libpngpf.3 b/libpngpf.3 index b7adac9ce..c815f25a8 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,6 +1,6 @@ -.TH LIBPNGPF 3 "January 15, 2012" +.TH LIBPNGPF 3 "January 16, 2012" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.6.0beta05 +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.0beta06 (private functions) .SH SYNOPSIS \fB#include \fI"pngpriv.h" diff --git a/png.5 b/png.5 index 54285d91b..685336dd3 100644 --- a/png.5 +++ b/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "January 15, 2012" +.TH PNG 5 "January 16, 2012" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/pngconf.h b/pngconf.h index 280980c7f..7d45165cb 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.0beta05 - January 15, 2012 + * libpng version 1.6.0beta06 - January 16, 2012 * * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngtest.c b/pngtest.c index 30e138447..38bdf49f2 100644 --- a/pngtest.c +++ b/pngtest.c @@ -1669,4 +1669,4 @@ main(int argc, char *argv[]) } /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_0beta05 Your_png_h_is_not_version_1_6_0beta05; +typedef png_libpng_version_1_6_0beta06 Your_png_h_is_not_version_1_6_0beta06; diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt index bd8c7e4ca..147506be5 100644 --- a/projects/vstudio/readme.txt +++ b/projects/vstudio/readme.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.6.0beta05 - January 15, 2012 +libpng version 1.6.0beta06 - January 16, 2012 Copyright (c) 1998-2010 Glenn Randers-Pehrson diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props index fd6133788..a85f751d3 100644 --- a/projects/vstudio/zlib.props +++ b/projects/vstudio/zlib.props @@ -2,7 +2,7 @@