summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/gregbook/readpng.c3
-rw-r--r--contrib/gregbook/writepng.c3
-rw-r--r--contrib/libtests/pngvalid.c32
-rw-r--r--contrib/pngsuite/README5
-rw-r--r--contrib/pngsuite/ftbbn0g01.pngbin0 -> 176 bytes
-rw-r--r--contrib/pngsuite/ftbbn0g02.pngbin0 -> 197 bytes
-rw-r--r--contrib/pngsuite/ftbbn0g04.png (renamed from contrib/pngsuite/ftbbn1g04.png)bin429 -> 429 bytes
-rw-r--r--contrib/pngsuite/ftbwn0g16.png (renamed from contrib/pngsuite/ftbwn1g16.png)bin1313 -> 1313 bytes
-rw-r--r--contrib/pngsuite/ftp0n0g08.png (renamed from contrib/pngsuite/ftp0n1g08.png)bin719 -> 719 bytes
-rw-r--r--contrib/visupng/PngFile.c1
-rw-r--r--contrib/visupng/VisualPng.c1
11 files changed, 25 insertions, 20 deletions
diff --git a/contrib/gregbook/readpng.c b/contrib/gregbook/readpng.c
index df42c301b..0b75fac6d 100644
--- a/contrib/gregbook/readpng.c
+++ b/contrib/gregbook/readpng.c
@@ -55,8 +55,9 @@
#include <stdio.h>
#include <stdlib.h>
+#include <zlib.h>
-#include "png.h" /* libpng header; includes zlib.h */
+#include "png.h" /* libpng header */
#include "readpng.h" /* typedefs, common macros, public prototypes */
/* future versions of libpng will provide this macro: */
diff --git a/contrib/gregbook/writepng.c b/contrib/gregbook/writepng.c
index f07f4a8a0..0dda62ea8 100644
--- a/contrib/gregbook/writepng.c
+++ b/contrib/gregbook/writepng.c
@@ -55,8 +55,9 @@
#include <stdlib.h> /* for exit() prototype */
+#include <zlib.h>
-#include "png.h" /* libpng header; includes zlib.h and setjmp.h */
+#include "png.h" /* libpng header, includes setjmp.h */
#include "writepng.h" /* typedefs, common macros, public prototypes */
diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c
index 3dd6f2133..e10381d81 100644
--- a/contrib/libtests/pngvalid.c
+++ b/contrib/libtests/pngvalid.c
@@ -1,7 +1,7 @@
/* pngvalid.c - validate libpng by constructing then reading png files.
*
- * Last changed in libpng 1.5.8 [%RDATE%]
+ * Last changed in libpng 1.5.8 [February 1, 2012]
* Copyright (c) 2012 Glenn Randers-Pehrson
* Written by John Cunningham Bowler
*
@@ -244,7 +244,7 @@ random_choice(void)
#define COL_FROM_ID(id) ((png_byte)((id)& 0x7U))
#define DEPTH_FROM_ID(id) ((png_byte)(((id) >> 3) & 0x1fU))
-#define PALETTE_FROM_ID(id) ((int)(((id) >> 8) & 0x1f))
+#define PALETTE_FROM_ID(id) (((id) >> 8) & 0x1f)
#define INTERLACE_FROM_ID(id) ((int)(((id) >> 13) & 0x3))
#define DO_INTERLACE_FROM_ID(id) ((int)(((id)>>15) & 1))
#define WIDTH_FROM_ID(id) (((id)>>16) & 0xff)
@@ -253,7 +253,7 @@ random_choice(void)
/* Utility to construct a standard name for a standard image. */
static size_t
standard_name(char *buffer, size_t bufsize, size_t pos, png_byte colour_type,
- int bit_depth, int npalette, int interlace_type,
+ int bit_depth, unsigned int npalette, int interlace_type,
png_uint_32 w, png_uint_32 h, int do_interlace)
{
pos = safecat(buffer, bufsize, pos, colour_types[colour_type]);
@@ -315,10 +315,11 @@ standard_name_from_id(char *buffer, size_t bufsize, size_t pos, png_uint_32 id)
/* The following defines the number of different palettes to generate for
* each log bit depth of a colour type 3 standard image.
*/
-#define PALETTE_COUNT(bit_depth) ((bit_depth) > 4 ? 1 : 16)
+#define PALETTE_COUNT(bit_depth) ((bit_depth) > 4 ? 1U : 16U)
static int
-next_format(png_bytep colour_type, png_bytep bit_depth, int* palette_number)
+next_format(png_bytep colour_type, png_bytep bit_depth,
+ unsigned int* palette_number)
{
if (*bit_depth == 0)
{
@@ -3256,8 +3257,8 @@ transform_row(png_structp pp, png_byte buffer[TRANSFORM_ROWMAX],
*/
static void
make_transform_image(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type,
- png_byte PNG_CONST bit_depth, int palette_number, int interlace_type,
- png_const_charp name)
+ png_byte PNG_CONST bit_depth, unsigned int palette_number,
+ int interlace_type, png_const_charp name)
{
context(ps, fault);
@@ -3384,7 +3385,7 @@ make_transform_images(png_store *ps)
{
png_byte colour_type = 0;
png_byte bit_depth = 0;
- int palette_number = 0;
+ unsigned int palette_number = 0;
/* This is in case of errors. */
safecat(ps->test, sizeof ps->test, 0, "make standard images");
@@ -7069,7 +7070,7 @@ perform_transform_test(png_modifier *pm)
{
png_byte colour_type = 0;
png_byte bit_depth = 0;
- int palette_number = 0;
+ unsigned int palette_number = 0;
while (next_format(&colour_type, &bit_depth, &palette_number))
{
@@ -8428,7 +8429,7 @@ perform_gamma_threshold_tests(png_modifier *pm)
{
png_byte colour_type = 0;
png_byte bit_depth = 0;
- int palette_number = 0;
+ unsigned int palette_number = 0;
/* Don't test more than one instance of each palette - it's pointless, in
* fact this test is somewhat excessive since libpng doesn't make this
@@ -8493,7 +8494,7 @@ static void perform_gamma_transform_tests(png_modifier *pm)
{
png_byte colour_type = 0;
png_byte bit_depth = 0;
- int palette_number = 0;
+ unsigned int palette_number = 0;
while (next_format(&colour_type, &bit_depth, &palette_number))
{
@@ -8522,11 +8523,8 @@ static void perform_gamma_sbit_tests(png_modifier *pm)
*/
for (sbit=pm->sbitlow; sbit<(1<<READ_BDHI); ++sbit)
{
- png_byte colour_type, bit_depth;
- int npalette;
-
- colour_type = bit_depth = 0;
- npalette = 0;
+ png_byte colour_type = 0, bit_depth = 0;
+ unsigned int npalette = 0;
while (next_format(&colour_type, &bit_depth, &npalette))
if ((colour_type & PNG_COLOR_MASK_ALPHA) == 0 &&
@@ -8742,7 +8740,7 @@ perform_gamma_composition_tests(png_modifier *pm, int do_background,
{
png_byte colour_type = 0;
png_byte bit_depth = 0;
- int palette_number = 0;
+ unsigned int palette_number = 0;
/* Skip the non-alpha cases - there is no setting of a transparency colour at
* present.
diff --git a/contrib/pngsuite/README b/contrib/pngsuite/README
index b2b1537db..ec4af9473 100644
--- a/contrib/pngsuite/README
+++ b/contrib/pngsuite/README
@@ -1,7 +1,8 @@
pngsuite
--------
-(c) Willem van Schaik, 1999, 2011
+(c) Willem van Schaik, 1999, 2011, 2012
+Two images are by Glenn Randers-Pehrson, 2012
Permission to use, copy, modify, and distribute these images for any
purpose and without fee is hereby granted.
@@ -38,6 +39,8 @@ can use them to test the proper functioning of PNG software.
basn6a08.png 8-bit RGBA
basn6a16.png 16-bit RGBA
+ ftbbn0g01.png 1-bit grayscale, black bKGD
+ ftbbn0g02.png 2-bit grayscale, black bKGD
ftbbn0g04.png 4-bit grayscale, black bKGD
ftbbn2c16.png 16-bit truecolor, black bKGD
ftbbn3p08.png 8-bit paletted, black bKGD
diff --git a/contrib/pngsuite/ftbbn0g01.png b/contrib/pngsuite/ftbbn0g01.png
new file mode 100644
index 000000000..ba746ffb2
--- /dev/null
+++ b/contrib/pngsuite/ftbbn0g01.png
Binary files differ
diff --git a/contrib/pngsuite/ftbbn0g02.png b/contrib/pngsuite/ftbbn0g02.png
new file mode 100644
index 000000000..3d83bd690
--- /dev/null
+++ b/contrib/pngsuite/ftbbn0g02.png
Binary files differ
diff --git a/contrib/pngsuite/ftbbn1g04.png b/contrib/pngsuite/ftbbn0g04.png
index 39a7050d2..39a7050d2 100644
--- a/contrib/pngsuite/ftbbn1g04.png
+++ b/contrib/pngsuite/ftbbn0g04.png
Binary files differ
diff --git a/contrib/pngsuite/ftbwn1g16.png b/contrib/pngsuite/ftbwn0g16.png
index 99bdeed2b..99bdeed2b 100644
--- a/contrib/pngsuite/ftbwn1g16.png
+++ b/contrib/pngsuite/ftbwn0g16.png
Binary files differ
diff --git a/contrib/pngsuite/ftp0n1g08.png b/contrib/pngsuite/ftp0n0g08.png
index 333465fcd..333465fcd 100644
--- a/contrib/pngsuite/ftp0n1g08.png
+++ b/contrib/pngsuite/ftp0n0g08.png
Binary files differ
diff --git a/contrib/visupng/PngFile.c b/contrib/visupng/PngFile.c
index ef0984e4d..dcde18a3a 100644
--- a/contrib/visupng/PngFile.c
+++ b/contrib/visupng/PngFile.c
@@ -13,6 +13,7 @@
#include <commdlg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <zlib.h>
#include "png.h"
#include "pngfile.h"
diff --git a/contrib/visupng/VisualPng.c b/contrib/visupng/VisualPng.c
index 009f120e3..236525a59 100644
--- a/contrib/visupng/VisualPng.c
+++ b/contrib/visupng/VisualPng.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <windows.h>
+#include <zlib.h>
/* application includes */