head 1.14; access; symbols pkgsrc-2017Q1:1.13.0.4 pkgsrc-2017Q1-base:1.13 pkgsrc-2016Q4:1.13.0.2 pkgsrc-2016Q4-base:1.13 pkgsrc-2016Q3:1.12.0.36 pkgsrc-2016Q3-base:1.12 pkgsrc-2016Q2:1.12.0.34 pkgsrc-2016Q2-base:1.12 pkgsrc-2016Q1:1.12.0.32 pkgsrc-2016Q1-base:1.12 pkgsrc-2015Q4:1.12.0.30 pkgsrc-2015Q4-base:1.12 pkgsrc-2015Q3:1.12.0.28 pkgsrc-2015Q3-base:1.12 pkgsrc-2015Q2:1.12.0.26 pkgsrc-2015Q2-base:1.12 pkgsrc-2015Q1:1.12.0.24 pkgsrc-2015Q1-base:1.12 pkgsrc-2014Q4:1.12.0.22 pkgsrc-2014Q4-base:1.12 pkgsrc-2014Q3:1.12.0.20 pkgsrc-2014Q3-base:1.12 pkgsrc-2014Q2:1.12.0.18 pkgsrc-2014Q2-base:1.12 pkgsrc-2014Q1:1.12.0.16 pkgsrc-2014Q1-base:1.12 pkgsrc-2013Q4:1.12.0.14 pkgsrc-2013Q4-base:1.12 pkgsrc-2013Q3:1.12.0.12 pkgsrc-2013Q3-base:1.12 pkgsrc-2013Q2:1.12.0.10 pkgsrc-2013Q2-base:1.12 pkgsrc-2013Q1:1.12.0.8 pkgsrc-2013Q1-base:1.12 pkgsrc-2012Q4:1.12.0.6 pkgsrc-2012Q4-base:1.12 pkgsrc-2012Q3:1.12.0.4 pkgsrc-2012Q3-base:1.12 pkgsrc-2012Q2:1.12.0.2 pkgsrc-2012Q2-base:1.12 pkgsrc-2012Q1:1.11.0.4 pkgsrc-2012Q1-base:1.11 pkgsrc-2011Q4:1.11.0.2 pkgsrc-2011Q4-base:1.11 pkgsrc-2011Q3:1.10.0.6 pkgsrc-2011Q3-base:1.10 pkgsrc-2011Q2:1.10.0.4 pkgsrc-2011Q2-base:1.10 pkgsrc-2011Q1:1.10.0.2 pkgsrc-2011Q1-base:1.10 pkgsrc-2009Q4:1.9.0.2 pkgsrc-2009Q4-base:1.9 pkgsrc-2008Q4:1.8.0.2 pkgsrc-2008Q4-base:1.8 pkgsrc-2008Q3:1.7.0.4 pkgsrc-2008Q3-base:1.7 cube-native-xorg:1.7.0.2 cube-native-xorg-base:1.7 pkgsrc-2008Q2:1.6.0.18 pkgsrc-2008Q2-base:1.6 cwrapper:1.6.0.16 pkgsrc-2008Q1:1.6.0.14 pkgsrc-2008Q1-base:1.6 pkgsrc-2007Q4:1.6.0.12 pkgsrc-2007Q4-base:1.6 pkgsrc-2007Q3:1.6.0.10 pkgsrc-2007Q3-base:1.6 pkgsrc-2007Q2:1.6.0.8 pkgsrc-2007Q2-base:1.6 pkgsrc-2007Q1:1.6.0.6 pkgsrc-2007Q1-base:1.6 pkgsrc-2006Q4:1.6.0.4 pkgsrc-2006Q4-base:1.6 pkgsrc-2006Q3:1.6.0.2 pkgsrc-2006Q3-base:1.6 pkgsrc-2006Q2:1.5.0.2 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.3.0.2 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.2.0.12 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.10 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.8 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.6 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.4 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.2 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.1.0.4 pkgsrc-2004Q2-base:1.1 pkgsrc-2004Q1:1.1.0.2 pkgsrc-2004Q1-base:1.1; locks; strict; comment @# @; 1.14 date 2017.04.10.08.59.34; author adam; state dead; branches; next 1.13; commitid H8J1LCkvjPPrZXMz; 1.13 date 2016.10.08.06.16.24; author adam; state Exp; branches; next 1.12; commitid CZGrD8SlcZqn0jpz; 1.12 date 2012.06.11.07.06.21; author adam; state Exp; branches; next 1.11; 1.11 date 2011.10.14.17.56.24; author adam; state Exp; branches; next 1.10; 1.10 date 2011.01.28.20.46.11; author adam; state Exp; branches; next 1.9; 1.9 date 2009.01.03.19.36.43; author adam; state dead; branches; next 1.8; 1.8 date 2008.10.26.09.19.16; author adam; state Exp; branches; next 1.7; 1.7 date 2008.07.18.08.41.20; author adam; state Exp; branches; next 1.6; 1.6 date 2006.07.06.20.51.25; author adam; state Exp; branches; next 1.5; 1.5 date 2006.06.10.07.43.11; author adam; state dead; branches; next 1.4; 1.4 date 2006.04.19.17.00.12; author wiz; state Exp; branches; next 1.3; 1.3 date 2006.02.18.11.07.10; author adam; state Exp; branches; next 1.2; 1.2 date 2004.08.29.16.44.48; author kim; state Exp; branches; next 1.1; 1.1 date 2004.01.12.21.23.05; author adam; state Exp; branches; next ; desc @@ 1.14 log @Version 1.8.11 (built with libpng-1.6.28 and zlib-1.2.11) Use png_set_option(PNG_IGNORE_ADLER32) to control ADLER32 handling. Changed LD=gcc to LD=$(CC) in Makefile and Makefile-nolib PkgSrc: Removed patch-aa as build and installation are done from the main Makefile. @ text @$NetBSD: patch-aa,v 1.13 2016/10/08 06:16:24 adam Exp $ Don't override CC, LD, CFLAGS and LDFLAGS. --- Makefile.orig 2016-10-03 05:16:21.000000000 +0000 +++ Makefile @@@@ -17,15 +17,11 @@@@ PNGLIB = /usr/local/lib ZINC = /usr/local/include ZLIB = /usr/local/lib -CC = gcc -LD = gcc RM = rm -f CPPFLAGS = -I $(PNGINC) -CFLAGS = -g -O3 -fomit-frame-pointer -Wall # [note that -Wall is a gcc-specific compilation flag ("all warnings on")] -LDFLAGS = O = .o E = @@@@ -54,7 +50,7 @@@@ pngcrush$(O): pngcrush.c cexcept.h mv png.h_embedded png.h $(PNGCRUSH)$(E): $(OBJS) - $(LD) $(LDFLAGS) -o $@@ $(OBJS) $(LIBS) + $(CC) $(LDFLAGS) -o $@@ $(OBJS) $(LIBS) # maintenance --------------------------------------------------------------- @ 1.13 log @Version 1.8.8 (built with libpng-1.6.26beta06 and zlib-1.2.8.1) Fixed "nolib" build (bug report by Hanspeter Niederstrasser). Make sure we use system-png.h, and not the local file. It is now possible to build either the regular pngcrush or the "nolib" pngcrush in the complete pngcrush source directory (use "make clean" before rebuilding!) Fixed timing when using "clock()". Sometimes an additional second was added when the timer crossed a one-second boundary, since version 1.8.5. Upgrade libpng to version 1.6.26beta06 and zlib to 1.2.8.1. Use zlib-1.2.8.1 new "inflateValidate()" function to avoid checking ADLER32 checksums. Version 1.8.7 did not work when the "-fix" option was used. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.12 2012/06/11 07:06:21 adam Exp $ @ 1.12 log @Changes 1.7.29: * Set "things_have_changed" flag when adding text chunks, so the "-force" option is no longer necessary when adding text to an already-compressed file. * Direct usage message and error messages to stderr instead of stdout. If anyone is still using DOS they may have to change the "if 0" at line 990 to "if 1". * Added "pngcrush -n -v files.png" to the usage message. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.11 2011/10/14 17:56:24 adam Exp $ d5 1 a5 1 --- Makefile.orig 2011-01-21 23:04:44.000000000 +0000 d7 3 a9 3 @@@@ -17,14 +17,10 @@@@ PNGLIB = ${HOME}/lib ZINC = ${HOME}/include ZLIB = ${HOME}/lib d14 4 a17 3 #CFLAGS = -I. -O -Wall #CFLAGS = -I. -O3 -fomit-frame-pointer -Wall -CFLAGS = -I${ZINC} -I. -g -O3 -fomit-frame-pointer -Wall d23 2 a24 2 @@@@ -68,7 +64,7 @@@@ pngcrush$(O): pngcrush.c cexcept.h # $(CC) -c $(CFLAGS) $< @ 1.11 log @Changes 1.7.20: * Removed the call to png_read_transform_info() when the system libpng is being used, so it can be built with a system libpng. Changes 1.7.19: * pngcrush-1.7.18 failed to read interlaced PNGs. Reverted the change from calling png_read_transform_info() to png_read_update_info(). Since png_read_transform_info() is not exported we again cannot build with the system libpng15. Changes 1.7.18: * This version will work with either a "system" libpng14 or libpng15, or with the embedded libpng15. The deprecated usage of libpng png_struct members and unexported functions has been removed. * Revised the format of the time report (all on one line so you can get a nice compact report by piping the output to "grep coding"). @ text @d1 3 a3 1 $NetBSD$ @ 1.10 log @Changes 1.7.14: * Built with libpng-1.5.1beta06 and zlib-1.2.5 * Removed WIN32_WCE support (libpng has dropped it already) * Include zlib.h and define png_memcpy, etc., and revise the png_get_iCCP() and png_set_iCCP() calls to be able to build with bundled libpng-1.5.x. Pngcrush cannot be built yet with a system libpng-1.5.x. @ text @d3 1 a3 1 --- Makefile.orig 2011-01-28 20:28:50.000000000 +0000 d5 3 a7 3 @@@@ -14,17 +14,13 @@@@ #ZINC = ../../zlib #ZLIB = ../../zlib a12 1 #CFLAGS = -I. -O2 -fomit-frame-pointer -Wall d14 1 a14 3 #CFLAGS = -I. -Os -fomit-frame-pointer -Wall -CFLAGS = -I. -O3 -funroll-loops -fomit-frame-pointer -Wall -Wshadow #CFLAGS = -I${ZINC} -I. -O3 -fomit-frame-pointer -Wall d20 2 a21 2 @@@@ -63,7 +59,7 @@@@ pngcrush$(O): pngcrush.c png.h pngconf.h $(CC) -c $(CFLAGS) $< @ 1.9 log @Changes 1.6.12: * Eliminated a memory leak in libpng with writing bad tEXt chunks. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.8 2008/10/26 09:19:16 adam Exp $ d3 5 a7 5 --- pngcrush.c.orig 2008-08-25 21:00:08.000000000 +0200 +++ pngcrush.c @@@@ -632,9 +632,6 @@@@ void png_crc_read(png_structp png_ptr, p int png_crc_error(png_structp png_ptr); int png_crc_finish(png_structp png_ptr, png_uint_32 skip); d9 13 a21 3 -png_uint_32 png_get_uint_31(png_structp png_ptr, png_bytep buf); -png_uint_32 png_get_uint_32(png_bytep buf); -void png_save_uint_32(png_bytep buf, png_uint_32 i); d23 8 a30 5 #ifdef PNG_USER_MEM_SUPPORTED png_voidp png_debug_malloc(png_structp png_ptr, png_uint_32 size); @@@@ -670,38 +667,6 @@@@ void print_usage(int retval); * ============================================================ */ a31 44 -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ -png_uint_32 /* PRIVATE */ -png_get_uint_32(png_bytep buf) -{ - png_uint_32 i = ((png_uint_32)(*buf) << 24) + - ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); - - return (i); -} -#else -# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) -#endif -png_uint_32 /* PRIVATE */ -png_get_uint_31(png_structp png_ptr, png_bytep buf) -{ - png_uint_32 i = png_get_uint_32(buf); - if (i > PNG_UINT_31_MAX) - png_error(png_ptr, "PNG unsigned integer out of range.\n"); - return (i); -} -void /* PRIVATE */ -png_save_uint_32(png_bytep buf, png_uint_32 i) -{ - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); -} - /* Reset the CRC variable to 32 bits of 1's. Care must be taken * in case CRC is > 32 bits to leave the top bits 0. */ @@@@ -2821,7 +2786,7 @@@@ int main(int argc, char *argv[]) #if !defined(PNG_cHRM_SUPPORTED) || !defined(PNG_hIST_SUPPORTED) || \ !defined(PNG_iCCP_SUPPORTED) || !defined(PNG_sCAL_SUPPORTED) || \ !defined(PNG_pCAL_SUPPORTED) || !defined(PNG_sPLT_SUPPORTED) || \ - !defined(PNG_tIME_SUPPORTED) + !defined(PNG_tIME_SUPPORTED) || !defined(PNG_sTER_SUPPORTED) png_byte chunk_name[5]; chunk_name[4] = '\0'; #endif @ 1.8 log @Changes 1.6.10: * Add sTER chunk support. Changes 1.6.9: * Updated cexcept.h to version 2.0.1 * Add missing curly brackets. Changes 1.6.8: * Fixed bug with handling of -z and -zi options. @ text @d1 1 a1 1 $NetBSD$ @ 1.7 log @Changes 1.6.7: Moved PNG_UINT_CHNK and some other defines from pngcrush.h to pngcrush.c Reject invalid color_type or bit_depth. Changes 1.6.6: Added dSIG support. Pngcrush will not rewrite an image containing a dSIG chunk immediately following the IHDR chunk, unless the dSIG is explicitly removed with "-rem dSIG" or explicitly kept with "-keep dSIG". In the latter case the saved dSIG chunks will become invalid if any changes are made to the datastream. Fixed bug in writing unknown chunks from the end_info_ptr. Changes 1.6.5: Discontinued adding a new gAMA chunk when writing sRGB chunk. @ text @d3 1 a3 1 --- pngcrush.c.orig 2008-06-13 03:50:52.000000000 +0200 d5 1 a5 1 @@@@ -624,9 +624,6 @@@@ void png_crc_read(png_structp png_ptr, p d15 1 a15 1 @@@@ -662,38 +659,6 @@@@ void print_usage(int retval); d54 9 @ 1.6 log @Fix building on Darwin @ text @d3 3 a5 3 --- pngcrush.c.orig 2006-07-06 22:32:25.000000000 +0200 +++ pngcrush.c 2006-07-06 22:41:02.000000000 +0200 @@@@ -444,9 +444,6 @@@@ d15 1 a15 1 @@@@ -482,38 +479,6 @@@@ @ 1.5 log @Changes 1.6.4: * Fixed bug in handling of undocumented -trns_a option. * Fixed bug with "nosave" handling of unknown chunks. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.4 2006/04/19 17:00:12 wiz Exp $ d3 5 a7 5 --- pngcrush.c.orig 2006-03-30 15:15:11.000000000 +0200 +++ pngcrush.c @@@@ -128,10 +128,12 @@@@ #define PNG_iCCP const png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} #define PNG_IEND const png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} d9 3 a11 6 +#if 0 PNG_EXPORT_VAR (const png_byte FARDATA) png_IHDR[5]; PNG_EXPORT_VAR (const png_byte FARDATA) png_IDAT[5]; PNG_EXPORT_VAR (const png_byte FARDATA) png_IEND[5]; PNG_EXPORT_VAR (const png_byte FARDATA) png_iCCP[5]; +#endif d13 41 a53 2 #define PNG_FLAG_CRC_CRITICAL_USE 0x0400 #define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 @ 1.4 log @Update to 1.6.3, and fix build after png-1.2.9nb2 update: Version 1.6.3 (built with libpng-1.2.9beta11 and zlib-1.2.3) Fixed documentation of iTXt input (Shlomi Tal). Removed #define PNG_INTERNAL and provided prototypes for some internal libpng functions that are duplicated in pngcrush.c @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @Changes 1.6.2: * Fixed bug with "PNG_ROWBYTES" usage, introduced in version 1.6.1. The bug could cause a crash and only affects the "nolib" builds. * Converted C++ style (// ...) comments to C style (/* ... */). * Defined TOO_FAR == 32767 in deflate.c (again). The definition was omitted from version 1.6.0 when zlib was upgraded to version 1.2.3. Changes 1.6.1: * Copied non-exported libpng functions from libpng into pngcrush, to make pngcrush play more nicely with shared libpng. These are ifdef'ed out when a static library is being built with the bundled libpng and pngcrush.h is included. Changes 1.6.0: * Moved ChangeLog out of pngcrush.c comments and into a separate file. * Filtered pngcrush.c through "indent -kr" and "expand" for readability. * Moved 550 lines of usage/help/copyright/license/version info to separate function(s) and cleaned up significantly. * Added some comments for ease of navigation and readability. * Stripped out a bunch of ancient-libpng compatibility stuff. * Defined PNG_UINT_* macros (pngcrush.h for now). * Fixed unknown-chunk handling ("-rem alla" and "-rem gifx" now work). * Created modified version of makefile that supports external zlib. * Added support for methods using Z_RLE zlib strategy (zlib 1.2.x only). * Documented -huffman option in usage screen. * Added IDAT statistics to final per-file summary. * Added utime() support to give output files same timestamps as input files. @ text @d3 1 a3 1 --- pngcrush.c.orig 2006-02-16 18:57:17.000000000 +0100 d5 3 a7 2 @@@@ -120,7 +120,20 @@@@ */ d9 5 a13 15 #define PNG_INTERNAL -#include "png.h" +#include + +#ifndef HANDLE_CHUNK_AS_DEFAULT +#define HANDLE_CHUNK_AS_DEFAULT PNG_HANDLE_CHUNK_AS_DEFAULT +#endif +#ifndef HANDLE_CHUNK_NEVER +#define HANDLE_CHUNK_NEVER PNG_HANDLE_CHUNK_NEVER +#endif +#ifndef HANDLE_CHUNK_IF_SAFE +#define HANDLE_CHUNK_IF_SAFE PNG_HANDLE_CHUNK_IF_SAFE +#endif +#ifndef HANDLE_CHUNK_ALWAYS +#define HANDLE_CHUNK_ALWAYS PNG_HANDLE_CHUNK_ALWAYS d16 2 a17 2 /* we don't need some of the extra libpng transformations * so they are ifdef'ed out in pngcrush.h, which is included by @ 1.2 log @Make this compile with png-1.2.6 @ text @d3 3 a5 3 --- pngcrush.c.orig 2002-07-20 23:51:20.000000000 -0400 +++ pngcrush.c 2004-08-29 12:43:38.000000000 -0400 @@@@ -416,7 +416,20 @@@@ d25 2 a26 2 /* we don't need the some of the extra libpng transformations * so they are ifdef'ed out in a special version of pngconf.h, which @ 1.1 log @Now links dynamically with zlib and libpng @ text @d3 3 a5 3 --- pngcrush.c.orig 2004-01-12 21:40:44.000000000 +0000 +++ pngcrush.c @@@@ -416,7 +416,7 @@@@ d11 13 @