summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>1999-12-28 12:18:10 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-04-16 10:46:38 -0500
commitc3e8db9e59d63d431aca628ea036b17fe5934596 (patch)
treec23ed3ff46a355700345e1d11a4c7663fefd7616
parente7cba14aff1b638fdb7b02790ed91192546cc276 (diff)
downloadlibpng-c3e8db9e59d63d431aca628ea036b17fe5934596.tar.gz
Imported from pngcrush-1.3.2.tarv1.3.2
-rw-r--r--INSTALL.txt (renamed from INSTALL)8
-rw-r--r--Makefile.gcc (renamed from makefile.gcc)0
-rw-r--r--README.txt36
-rw-r--r--pngcrush.c32
-rw-r--r--pngcrush.h2
5 files changed, 62 insertions, 16 deletions
diff --git a/INSTALL b/INSTALL.txt
index 0c091074a..efb5cc683 100644
--- a/INSTALL
+++ b/INSTALL.txt
@@ -1,16 +1,16 @@
-There's a sample makefile.gcc for pngcrush, which you can use
+There's a sample Makefile.gcc for pngcrush, which you can use
by typing
- make -f makefile.gcc
+ make -f Makefile.gcc
-However, all you should need to do is enter the pngcrush-1.3.0
+However, all you should need to do is enter the pngcrush-n.n.n
directory and type
cc -O -o pngcrush *.c -lm
cp pngcrush /usr/local/bin # or wherever you want
-You might want to create a makefile if you are planning to do
+You might want to create your own Makefile if you are planning to do
something more complicated, like loading with your system's shared
libraries for libpng and zlib.
diff --git a/makefile.gcc b/Makefile.gcc
index 095868ba8..095868ba8 100644
--- a/makefile.gcc
+++ b/Makefile.gcc
diff --git a/README.txt b/README.txt
index 1d298250e..289f2c095 100644
--- a/README.txt
+++ b/README.txt
@@ -1,5 +1,35 @@
-
- | pngcrush 1.3.1, Copyright (C) 1998, 1999, Glenn Randers-Pehrson
+Pngcrush documentation
+
+This is the copyright notice, disclaimer, and license:
+
+/*
+ * COPYRIGHT NOTICE, DISCLAIMER, AND LICENSE:
+ *
+ * Copyright (c) 1998, 1999, Glenn Randers-Pehrson
+ *
+ * The pngcrush program is supplied "AS IS". The Author disclaims all
+ * warranties, expressed or implied, including, without limitation, the
+ * warranties of merchantability and of fitness for any purpose. The
+ * Author assumes no liability for direct, indirect, incidental, special,
+ * exemplary, or consequential damages, which may result from the use of
+ * the pngcrush program, even if advised of the possibility of such damage.
+ *
+ * Permission is hereby granted to use, copy, modify, and distribute this
+ * source code, or portions hereof, for any purpose, without fee, subject
+ * to the following restrictions:
+ *
+ * 1. The origin of this source code must not be misrepresented.
+ *
+ * 2. Altered versions must be plainly marked as such and must not be
+ * misrepresented as being the original source.
+ *
+ * 3. This Copyright notice, disclaimer, and license may not be removed
+ * or altered from any source or altered source distribution.
+ */
+
+This is the output of "pngcrush" and "pngcrush -help":
+
+ | pngcrush 1.3.2, Copyright (C) 1998, 1999, Glenn Randers-Pehrson
| This is a free, open-source program. Permission is
| granted to everyone to use pngcrush without fee.
| This program was built with libpng version 1.0.5k,
@@ -13,6 +43,7 @@
usage: pngcrush [options] infile.png outfile.png
pngcrush -e ext [other options] files.png ...
pngcrush -d dir [other options] files.png ...
+
options:
-brute (Use brute-force, try 114 different methods)
-c color_type of output file [0, 2, 4, or 6]
@@ -40,6 +71,7 @@ options:
-h (help)
-p (pause)
+
options:
-brute (Use brute-force, try 114 different methods)
diff --git a/pngcrush.c b/pngcrush.c
index 5d1cc7c00..82c4595b8 100644
--- a/pngcrush.c
+++ b/pngcrush.c
@@ -15,7 +15,7 @@
* occasionally creating Linux executables.
*/
-#define PNGCRUSH_VERSION "1.3.1"
+#define PNGCRUSH_VERSION "1.3.2"
/*
* COPYRIGHT NOTICE, DISCLAIMER, AND LICENSE:
@@ -54,6 +54,15 @@
*
* Change log:
*
+ * Version 1.3.2 (built with libpng-1.0.5k)
+ *
+ * Renamed "dirname" to "directory_name" to avoid conflict with "dirname"
+ * that appears in string.h on some platforms.
+ *
+ * Fixed "PNG_NO_FLOAING_POINT" typo in pngcrush.h
+ *
+ * #ifdef'ed out parts of the help screen for options that are unsupported.
+ *
* Version 1.3.1 (built with libpng-1.0.5k): Eliminated some spurious warnings
* that were being issued by libpng-1.0.5j. Added -itxt, -ztxt, and
* -zitxt descriptions to the help screen.
@@ -161,7 +170,7 @@
static PNG_CONST char *progname = "pngtest.png";
static PNG_CONST char *inname = "pngtest.png";
static PNG_CONST char *outname = "pngout.png";
-static PNG_CONST char *dirname = "pngcrush.bak";
+static PNG_CONST char *directory_name = "pngcrush.bak";
static PNG_CONST char *extension = "_C.png";
static int all_chunks_are_safe=0;
@@ -641,7 +650,7 @@ main(int argc, char *argv[])
{
i++;
pngcrush_mode=DIRECTORY_MODE;
- dirname= argv[names++];
+ directory_name= argv[names++];
}
else if(!strncmp(argv[i],"-e",2))
{
@@ -784,11 +793,13 @@ main(int argc, char *argv[])
things_have_changed=1;
}
#endif
+#ifdef PNG_pHYs_SUPPORTED
else if(!strncmp(argv[i],"-res",4))
{
names++;
resolution=atoi(argv[++i]);
}
+#endif
else if(!strncmp(argv[i],"-r",2))
{
remove_chunks=i;
@@ -797,6 +808,7 @@ main(int argc, char *argv[])
}
else if( !strncmp(argv[i],"-save",5))
all_chunks_are_safe++;
+#ifdef PNG_sRGB_SUPPORTED
else if( !strncmp(argv[i],"-srgb",5) ||
!strncmp(argv[i],"-sRGB",5))
{
@@ -816,6 +828,7 @@ main(int argc, char *argv[])
else
i--;
}
+#endif
else if(!strncmp(argv[i],"-s",2))
verbose=0;
else if( !strncmp(argv[i],"-text",5) || !strncmp(argv[i],"-tEXt",5) ||
@@ -993,6 +1006,7 @@ main(int argc, char *argv[])
else if(default_compression_window == 2) default_compression_window=11;
else if(default_compression_window == 1) default_compression_window=10;
else if(default_compression_window == 512) default_compression_window= 9;
+ /* Use of compression window size 256 is not recommended. */
else if(default_compression_window == 256) default_compression_window= 8;
else if(default_compression_window != 15)
{
@@ -1396,20 +1410,20 @@ main(int argc, char *argv[])
if(pngcrush_mode == DIRECTORY_MODE)
{
struct stat stat_buf;
- if(stat(dirname, &stat_buf) != 0)
+ if(stat(directory_name, &stat_buf) != 0)
{
-#ifdef _MBCS
- if(_mkdir(dirname) != 0)
+#if defined(_MBCS) || defined(__WIN32__)
+ if(_mkdir(directory_name) != 0)
#else
- if(mkdir(dirname, 0x1ed) != 0)
+ if(mkdir(directory_name, 0x1ed) != 0)
#endif
{
- fprintf(STDERR,"could not create directory %s\n",dirname);
+ fprintf(STDERR,"could not create directory %s\n",directory_name);
return 1;
}
}
out_string[0] = '\0';
- str_return = strcat(out_string,dirname);
+ str_return = strcat(out_string,directory_name);
str_return = strcat(out_string,SLASH);
in_string[0] = '\0';
diff --git a/pngcrush.h b/pngcrush.h
index c32f53316..77f0dbdf4 100644
--- a/pngcrush.h
+++ b/pngcrush.h
@@ -3,7 +3,7 @@
/* Special defines for pngcrush, mostly just to reduce the size of the
static executable. */
-#define PNG_NO_FLOAING_POINT_SUPPORTED /* undef this if you want to be able
+#define PNG_NO_FLOATING_POINT_SUPPORTED /* undef this if you want to be able
to reduce color to gray */
#define PNG_NO_READ_cHRM
#define PNG_NO_WRITE_cHRM