diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2014-02-24 18:40:37 -0600 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2014-02-24 19:08:57 -0600 |
commit | b35feda8f1c32e4a21ef689033d42768c2ce9937 (patch) | |
tree | 0ed64ca29d1654cb336f62e89759e8268d54baea | |
parent | 9e0653457279240fde82207c96c76d544cbd5d3f (diff) | |
download | libpng-1.6.10beta03.tar.gz |
[libpng16] Imported from libpng-1.6.10beta03.tarv1.6.10beta03
-rw-r--r-- | LICENSE | 4 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | libpngpf.3 | 2 | ||||
-rw-r--r-- | png.5 | 2 | ||||
-rw-r--r-- | png.c | 4 | ||||
-rw-r--r-- | pngconf.h | 2 | ||||
-rw-r--r-- | pngtopng.c | 92 | ||||
-rw-r--r-- | projects/vstudio/readme.txt | 2 | ||||
-rw-r--r-- | projects/vstudio/zlib.props | 2 | ||||
-rw-r--r-- | scripts/README.txt | 2 | ||||
-rw-r--r-- | scripts/pnglibconf.h.prebuilt | 2 |
11 files changed, 104 insertions, 12 deletions
@@ -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.10beta03, February 23, 2014, are +libpng versions 1.2.6, August 15, 2004, through 1.6.10beta03, February 25, 2014, are Copyright (c) 2004, 2006-2014 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 -February 23, 2014 +February 25, 2014 @@ -1,4 +1,4 @@ -README for libpng version 1.6.10beta03 - February 23, 2014 (shared library 16.0) +README for libpng version 1.6.10beta03 - February 25, 2014 (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/libpngpf.3 b/libpngpf.3 index 370a82263..3062fd97c 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,4 +1,4 @@ -.TH LIBPNGPF 3 "February 23, 2014" +.TH LIBPNGPF 3 "February 25, 2014" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.6.10beta03 (private functions) @@ -1,4 +1,4 @@ -.TH PNG 5 "February 23, 2014" +.TH PNG 5 "February 25, 2014" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION @@ -773,13 +773,13 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.10beta03 - February 23, 2014" PNG_STRING_NEWLINE \ + "libpng version 1.6.10beta03 - February 25, 2014" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.6.10beta03 - February 23, 2014\ + return "libpng version 1.6.10beta03 - February 25, 2014\ Copyright (c) 1998-2014 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.10beta03 - February 23, 2014 + * libpng version 1.6.10beta03 - February 25, 2014 * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngtopng.c b/pngtopng.c new file mode 100644 index 000000000..b1b3be677 --- /dev/null +++ b/pngtopng.c @@ -0,0 +1,92 @@ +/*- pngtopng + * + * COPYRIGHT: Written by John Cunningham Bowler, 2011. + * To the extent possible under law, the author has waived all copyright and + * related or neighboring rights to this work. This work is published from: + * United States. + * + * Read a PNG and write it out in a fixed format, using the 'simplified API' + * that was introduced in libpng-1.6.0. + * + * This sample code is just the code from the top of 'example.c' with some error + * handling added. See example.c for more comments. + */ +#include <stddef.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +/* Normally use <png.h> here to get the installed libpng, but this is done to + * ensure the code picks up the local libpng implementation: + */ +#include "../../png.h" + +int main(int argc, const char **argv) +{ + int result = 1; + + if (argc == 3) + { + png_image image; + + /* Only the image structure version number needs to be set. */ + memset(&image, 0, sizeof image); + image.version = PNG_IMAGE_VERSION; + + if (png_image_begin_read_from_file(&image, argv[1])) + { + png_bytep buffer; + + /* Change this to try different formats! If you set a colormap format + * then you must also supply a colormap below. + */ + image.format = PNG_FORMAT_RGBA; + + buffer = malloc(PNG_IMAGE_SIZE(image)); + + if (buffer != NULL) + { + if (png_image_finish_read(&image, NULL/*background*/, buffer, + 0/*row_stride*/, NULL/*colormap for PNG_FORMAT_FLAG_COLORMAP */)) + { + if (png_image_write_to_file(&image, argv[2], + 0/*convert_to_8bit*/, buffer, 0/*row_stride*/, + NULL/*colormap*/)) + result = 0; + + else + fprintf(stderr, "pngtopng: write %s: %s\n", argv[2], + image.message); + + free(buffer); + } + + else + { + fprintf(stderr, "pngtopng: read %s: %s\n", argv[1], + image.message); + + /* This is the only place where a 'free' is required; libpng does + * the cleanup on error and success, but in this case we couldn't + * complete the read because of running out of memory. + */ + png_image_free(&image); + } + } + + else + fprintf(stderr, "pngtopng: out of memory: %lu bytes\n", + (unsigned long)PNG_IMAGE_SIZE(image)); + } + + else + /* Failed to read the first argument: */ + fprintf(stderr, "pngtopng: %s: %s\n", argv[1], image.message); + } + + else + /* Wrong number of arguments */ + fprintf(stderr, "pngtopng: usage: pngtopng input-file output-file\n"); + + return result; +} diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt index 983955ae8..470944bf5 100644 --- a/projects/vstudio/readme.txt +++ b/projects/vstudio/readme.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.6.10beta03 - February 23, 2014 +libpng version 1.6.10beta03 - February 25, 2014 Copyright (c) 1998-2010 Glenn Randers-Pehrson diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props index 4b4630811..a76de0812 100644 --- a/projects/vstudio/zlib.props +++ b/projects/vstudio/zlib.props @@ -2,7 +2,7 @@ <!-- * zlib.props - location of zlib source * - * libpng version 1.6.10beta03 - February 23, 2014 + * libpng version 1.6.10beta03 - February 25, 2014 * * Copyright (c) 1998-2011 Glenn Randers-Pehrson * diff --git a/scripts/README.txt b/scripts/README.txt index 62a2de492..5d7d09502 100644 --- a/scripts/README.txt +++ b/scripts/README.txt @@ -1,5 +1,5 @@ -Makefiles for libpng version 1.6.10beta03 - February 23, 2014 +Makefiles for libpng version 1.6.10beta03 - February 25, 2014 pnglibconf.h.prebuilt => Stores configuration settings makefile.linux => Linux/ELF makefile diff --git a/scripts/pnglibconf.h.prebuilt b/scripts/pnglibconf.h.prebuilt index 6eb3f8b08..1d284647e 100644 --- a/scripts/pnglibconf.h.prebuilt +++ b/scripts/pnglibconf.h.prebuilt @@ -2,7 +2,7 @@ /* pnglibconf.h - library build configuration */ -/* Libpng version 1.6.10beta03 - February 23, 2014 */ +/* Libpng version 1.6.10beta03 - February 25, 2014 */ /* Copyright (c) 1998-2013 Glenn Randers-Pehrson */ |