Imported from libpng-1.2.9beta8.tar
diff --git a/ANNOUNCE b/ANNOUNCE
index 2173d66..a357579 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.2.9beta7 - March 7, 2006
+Libpng 1.2.9beta8 - March 9, 2006
 
 This is not intended to be a public release.  It will be replaced
 within a few weeks by a public version or by another test version.
@@ -9,26 +9,26 @@
 Source files with LF line endings (for Unix/Linux) and with a
 "configure" script
 
-   1.2.9beta7.tar.gz
-   1.2.9beta7.tar.bz2
+   1.2.9beta8.tar.gz
+   1.2.9beta8.tar.bz2
 
 Source files with CRLF line endings (for Windows), without the
 "configure" script
 
-   lp129b07.zip
-   lp129b07.tar.bz2
+   lp129b08.zip
+   lp129b08.tar.bz2
 
 Project files
 
-   1.2.9beta7-project-netware.zip
-   1.2.9beta7-project-wince.zip
+   1.2.9beta8-project-netware.zip
+   1.2.9beta8-project-wince.zip
 
 Other information:
 
-   1.2.9beta7-README.txt
-   1.2.9beta7-KNOWNBUGS.txt
-   1.2.9beta7-LICENSE.txt
-   1.2.9beta7-Y2K-compliance.txt
+   1.2.9beta8-README.txt
+   1.2.9beta8-KNOWNBUGS.txt
+   1.2.9beta8-LICENSE.txt
+   1.2.9beta8-Y2K-compliance.txt
 
 Changes since the last public release (1.2.8):
 
@@ -43,7 +43,6 @@
   Make sure num_palette is <= 256 before copying data in png_set_PLTE().
   Interchanged order of write_swap_alpha and write_invert_alpha transforms.
   Added parentheses in the definition of PNG_LIBPNG_BUILD_TYPE (Cosmin).
-  Fixed inconsistency in definition of png_default_read_data()
   Exported png_get_uint_32, png_save_uint_32, png_get_uint_16, png_save_uint_16,
     png_get_int_32, png_save_int_32, png_get_uint_31 (Cosmin).
   Added parentheses in the definition of PNG_LIBPNG_BUILD_TYPE (Cosmin).
@@ -112,6 +111,17 @@
   Made cosmetic changes to some makefiles, adding LN_SF and other macros.
   Made some makefiles accept "exec_prefix".
 
+version 1.2.9beta8 [March 9, 2006]
+  Fixed some "#ifdef defined (..." which should be "#ifdef defined(..."
+    Bug introduced in libpng-1.2.8.
+  Fixed inconsistency in definition of png_default_read_data()
+  Restored blank that was lost from makefile.sggcc "clean" target in beta7.
+  Revised calculation of "current" and "major" for irix in ltmain.sh
+  Changed "mkdir" to "MKDIR_P" in some makefiles.
+  Separated PNG_EXPAND and PNG_EXPAND_tRNS.
+  Added png_set_expand_gray_1_2_4_to_8() and deprecated
+    png_set_gray_1_2_4_to_8() which also expands tRNS to alpha.
+
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit 
 https://lists.sourceforge.net/lists/listinfo/png-mng-implement
diff --git a/CHANGES b/CHANGES
index 104fe37..753be5b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1430,7 +1430,6 @@
   Added parentheses in the definition of PNG_LIBPNG_BUILD_TYPE (Cosmin).
   Optimized zlib window flag (CINFO) in contrib/pngsuite/*.png (Cosmin).
   Updated scripts/makefile.bc32 for Borland C++ 5.6 (Cosmin).
-  Fixed inconsistency in definition of png_default_read_data()
   Exported png_get_uint_32, png_save_uint_32, png_get_uint_16, png_save_uint_16,
     png_get_int_32, png_save_int_32, png_get_uint_31 (Cosmin).
   Added type cast (png_byte) in png_write_sCAL() (Cosmin).
@@ -1491,10 +1490,22 @@
   Made cosmetic changes to some makefiles, adding LN_SF and other macros.
   Made some makefiles accept "exec_prefix".
 
+version 1.2.9beta8 [March 9, 2006]
+  Fixed some "#ifdef defined (..." which should be "#ifdef defined(..."
+    Bug introduced in libpng-1.2.8.
+  Fixed inconsistency in definition of png_default_read_data()
+  Restored blank that was lost from makefile.sggcc "clean" target in beta7.
+  Revised calculation of "current" and "major" for irix in ltmain.sh
+  Changed "mkdir" to "MKDIR_P" in some makefiles.
+  Separated PNG_EXPAND and PNG_EXPAND_tRNS.
+  Added png_set_expand_gray_1_2_4_to_8() and deprecated
+    png_set_gray_1_2_4_to_8() which also expands tRNS to alpha.
+
 version 1.4.0beta1 [future]
   Enabled iTXt support (changes png_struct, thus requires so-number change).
   Removed deprecated functions png_read_init, png_write_init, png_info_init,
-    png_permit_empty_plte and deprecated macro PNG_MAX_UINT.
+    png_permit_empty_plte, png_set_gray_1_2_4_to_8, and deprecated macro
+    PNG_MAX_UINT.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/INSTALL b/INSTALL
index df419e2..a51acfc 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
 
-Installing libpng version 1.2.9beta7 - March 7, 2006
+Installing libpng version 1.2.9beta8 - March 9, 2006
 
 On Unix/Linux and similar systems, you can simply type
 
@@ -29,7 +29,7 @@
 correspond to the version of zlib that's installed.
 
 You can rename the directories that you downloaded (they
-might be called "libpng-1.2.9beta7" or "lpng109" and "zlib-1.2.1"
+might be called "libpng-1.2.9beta8" or "lpng109" and "zlib-1.2.1"
 or "zlib121") so that you have directories called "zlib" and "libpng".
 
 Your directory structure should look like this:
@@ -85,11 +85,11 @@
 
  makefile.std      =>  Generic UNIX makefile (cc, creates static libpng.a)
  makefile.elf      =>  Linux/ELF makefile symbol versioning,
-                       gcc, creates libpng12.so.0.1.2.9beta7)
+                       gcc, creates libpng12.so.0.1.2.9beta8)
  makefile.linux    =>  Linux/ELF makefile
-                       (gcc, creates libpng12.so.0.1.2.9beta7)
+                       (gcc, creates libpng12.so.0.1.2.9beta8)
  makefile.gcmmx    =>  Linux/ELF makefile
-                       (gcc, creates libpng12.so.0.1.2.9beta7,
+                       (gcc, creates libpng12.so.0.1.2.9beta8,
                        uses assembler code tuned for Intel MMX platform)
  makefile.gcc      =>  Generic makefile (gcc, creates static libpng.a)
  makefile.knr      =>  Archaic UNIX Makefile that converts files with
@@ -112,12 +112,12 @@
  makefile.openbsd  =>  OpenBSD makefile
  makefile.sgi      =>  Silicon Graphics IRIX makefile (cc, creates static lib)
  makefile.sggcc    =>  Silicon Graphics (gcc,
-                       creates libpng12.so.0.1.2.9beta7)
+                       creates libpng12.so.0.1.2.9beta8)
  makefile.sunos    =>  Sun makefile
  makefile.solaris  =>  Solaris 2.X makefile (gcc,
-                       creates libpng12.so.0.1.2.9beta7)
+                       creates libpng12.so.0.1.2.9beta8)
  makefile.so9      =>  Solaris 9 makefile (gcc,
-                       creates libpng12.so.0.1.2.9beta7)
+                       creates libpng12.so.0.1.2.9beta8)
  makefile.32sunu   =>  Sun Ultra 32-bit makefile
  makefile.64sunu   =>  Sun Ultra 64-bit makefile
  makefile.sco      =>  For SCO OSr5  ELF and Unixware 7 with Native cc
diff --git a/KNOWNBUG b/KNOWNBUG
index dc99f44..7f8c25a 100644
--- a/KNOWNBUG
+++ b/KNOWNBUG
@@ -1,5 +1,5 @@
 
-Known bugs in libpng version 1.2.9beta7
+Known bugs in libpng version 1.2.9beta8
 
 1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
    reading interlaced PNG files, when assembler code is enabled but running
@@ -14,12 +14,7 @@
    STATUS: This is a subject of debate. The change will probably be made
    as a part of a major overhaul of the makefiles in libpng version 1.3.0.
 
-3. February 23, 2006: The custom makefiles don't support --exec-prefix.
-
-   STATUS: For now, use "configure".  This will probably be fixed in
-   libpng-1.3.0.
-
-4. February 24, 2006: The Makefile generated by the "configure" script
+3. February 24, 2006: The Makefile generated by the "configure" script
    fails to install symbolic links
    libpng12.so => libpng12.so.0.1.2.9betaN
    that are generated by the custom makefiles.
diff --git a/LICENSE b/LICENSE
index d377467..a33dfcf 100644
--- a/LICENSE
+++ b/LICENSE
@@ -8,7 +8,7 @@
 If you modify libpng you may insert additional notices immediately following
 this sentence.
 
-libpng versions 1.2.6, August 15, 2004, through 1.2.9beta7, March 7, 2006, are
+libpng versions 1.2.6, August 15, 2004, through 1.2.9beta8, March 9, 2006, are
 Copyright (c) 2004, 2006 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
@@ -106,4 +106,4 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-March 7, 2006
+March 9, 2006
diff --git a/README b/README
index f9f4b14..23610ca 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README for libpng version 1.2.9beta7 - March 7, 2006 (shared library 12.0)
+README for libpng version 1.2.9beta8 - March 9, 2006 (shared library 12.0)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
@@ -190,11 +190,11 @@
        descrip.mms      =>  VMS makefile for MMS or MMK
        makefile.std     =>  Generic UNIX makefile (cc, creates static libpng.a)
        makefile.elf     =>  Linux/ELF makefile symbol versioning,
-                            gcc, creates libpng12.so.0.1.2.9beta7)
+                            gcc, creates libpng12.so.0.1.2.9beta8)
        makefile.linux   =>  Linux/ELF makefile
-                            (gcc, creates libpng12.so.0.1.2.9beta7)
+                            (gcc, creates libpng12.so.0.1.2.9beta8)
        makefile.gcmmx   =>  Linux/ELF makefile
-                            (gcc, creates libpng12.so.0.1.2.9beta7,
+                            (gcc, creates libpng12.so.0.1.2.9beta8,
                             uses assembler code tuned for Intel MMX platform)
        makefile.gcc     =>  Generic makefile (gcc, creates static libpng.a)
        makefile.knr     =>  Archaic UNIX Makefile that converts files with
@@ -216,12 +216,12 @@
        makefile.openbsd =>  OpenBSD makefile
        makefile.sgi     =>  Silicon Graphics IRIX (cc, creates static lib)
        makefile.sggcc   =>  Silicon Graphics
-                            (gcc, creates libpng12.so.0.1.2.9beta7)
+                            (gcc, creates libpng12.so.0.1.2.9beta8)
        makefile.sunos   =>  Sun makefile
        makefile.solaris =>  Solaris 2.X makefile
-                            (gcc, creates libpng12.so.0.1.2.9beta7)
+                            (gcc, creates libpng12.so.0.1.2.9beta8)
        makefile.so9     =>  Solaris 9 makefile
-                            (gcc, creates libpng12.so.0.1.2.9beta7)
+                            (gcc, creates libpng12.so.0.1.2.9beta8)
        makefile.32sunu  =>  Sun Ultra 32-bit makefile
        makefile.64sunu  =>  Sun Ultra 64-bit makefile
        makefile.sco     =>  For SCO OSr5  ELF and Unixware 7 with Native cc
diff --git a/Y2KINFO b/Y2KINFO
index 25156c9..cad39c2 100644
--- a/Y2KINFO
+++ b/Y2KINFO
@@ -1,13 +1,13 @@
    Y2K compliance in libpng:
    =========================
 
-      March 7, 2006
+      March 9, 2006
 
       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.2.9beta7 are Y2K compliant.  It is my belief that earlier
+      upward through 1.2.9beta8 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
diff --git a/configure b/configure
index 1826dff..0c85466 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for libpng 1.2.9beta7.
+# Generated by GNU Autoconf 2.59 for libpng 1.2.9beta8.
 #
 # Report bugs to <png-mng-implement@lists.sourceforge.net>.
 #
@@ -423,8 +423,8 @@
 # Identity of this package.
 PACKAGE_NAME='libpng'
 PACKAGE_TARNAME='libpng'
-PACKAGE_VERSION='1.2.9beta7'
-PACKAGE_STRING='libpng 1.2.9beta7'
+PACKAGE_VERSION='1.2.9beta8'
+PACKAGE_STRING='libpng 1.2.9beta8'
 PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
 
 ac_unique_file="pngget.c"
@@ -954,7 +954,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libpng 1.2.9beta7 to adapt to many kinds of systems.
+\`configure' configures libpng 1.2.9beta8 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1020,7 +1020,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libpng 1.2.9beta7:";;
+     short | recursive ) echo "Configuration of libpng 1.2.9beta8:";;
    esac
   cat <<\_ACEOF
 
@@ -1167,7 +1167,7 @@
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-libpng configure 1.2.9beta7
+libpng configure 1.2.9beta8
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1181,7 +1181,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libpng $as_me 1.2.9beta7, which was
+It was created by libpng $as_me 1.2.9beta8, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1824,7 +1824,7 @@
 
 # Define the identity of the package.
  PACKAGE='libpng'
- VERSION='1.2.9beta7'
+ VERSION='1.2.9beta8'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -1979,7 +1979,7 @@
 
 
 
-PNGLIB_VERSION=1.2.9beta7
+PNGLIB_VERSION=1.2.9beta8
 PNGLIB_MAJOR=12
 PNGLIB_MINOR=9
 
@@ -20833,7 +20833,7 @@
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by libpng $as_me 1.2.9beta7, which was
+This file was extended by libpng $as_me 1.2.9beta8, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -20896,7 +20896,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-libpng config.status 1.2.9beta7
+libpng config.status 1.2.9beta8
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/configure.ac b/configure.ac
index 1d78d57..8358089 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,12 +18,12 @@
 
 dnl Version number stuff here:
 
-AC_INIT([libpng], [1.2.9beta7], [png-mng-implement@lists.sourceforge.net])
+AC_INIT([libpng], [1.2.9beta8], [png-mng-implement@lists.sourceforge.net])
 AM_INIT_AUTOMAKE
 dnl stop configure from automagically running automake
 AM_MAINTAINER_MODE
 
-PNGLIB_VERSION=1.2.9beta7
+PNGLIB_VERSION=1.2.9beta8
 PNGLIB_MAJOR=12
 PNGLIB_MINOR=9
 
diff --git a/libpng.3 b/libpng.3
index 165e741..5a590ec 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "March 7, 2006"
+.TH LIBPNG 3 "March 9, 2006"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.2.9beta7
+libpng \- Portable Network Graphics (PNG) Reference Library 1.2.9beta8
 .SH SYNOPSIS
 \fI\fB
 
@@ -502,6 +502,10 @@
 
 \fI\fB
 
+\fBvoid png_set_expand_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP
+
+\fI\fB
+
 \fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP
 
 \fI\fB
@@ -817,7 +821,7 @@
 .SH LIBPNG.TXT
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.2.9beta7 - March 7, 2006
+ libpng version 1.2.9beta8 - March 9, 2006
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2005 Glenn Randers-Pehrson
@@ -1604,7 +1608,7 @@
         png_set_palette_to_rgb(png_ptr);
 
     if (color_type == PNG_COLOR_TYPE_GRAY &&
-        bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
+        bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
 
     if (png_get_valid(png_ptr, info_ptr,
         PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
@@ -1614,6 +1618,11 @@
 readability.  In some future version they may actually do different
 things.
 
+As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
+added.  It expands the sample depth without changing tRNS to alpha.
+At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
+will be removed from a future version.
+
 PNG can have files with 16 bits per channel.  If you only can handle
 8 bits per channel, this will strip the pixels down to 8 bit.
 
@@ -3721,13 +3730,13 @@
 
 .SH IX. Y2K Compliance in libpng
 
-March 7, 2006
+March 9, 2006
 
 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.2.9beta7 are Y2K compliant.  It is my belief that earlier
+upward through 1.2.9beta8 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
@@ -3881,7 +3890,7 @@
  1.0.18              10    10018  12.so.0.1.0.18
  1.2.8               13    10208  12.so.0.1.2.8
  1.2.9beta1-3        13    10209  12.so.0.1.2.9beta1-3
- 1.2.9beta4-7        13    10209  12.so.0.9[.0]
+ 1.2.9beta4-8        13    10209  12.so.0.9[.0]
 
 Henceforth the source version will match the shared-library minor
 and patch numbers; the shared-library major version number will be
@@ -3937,7 +3946,7 @@
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.2.9beta7 - March 7, 2006:
+Libpng version 1.2.9beta8 - March 9, 2006:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
 
@@ -3958,7 +3967,7 @@
 If you modify libpng you may insert additional notices immediately following
 this sentence.
 
-libpng versions 1.2.6, August 15, 2004, through 1.2.9beta7, March 7, 2006, are
+libpng versions 1.2.6, August 15, 2004, through 1.2.9beta8, March 9, 2006, are
 Copyright (c) 2004-2006 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
@@ -4057,7 +4066,7 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-March 7, 2006
+March 9, 2006
 
 .\" end of man page
 
diff --git a/libpng.txt b/libpng.txt
index 7867d75..1c6b847 100644
--- a/libpng.txt
+++ b/libpng.txt
@@ -1,6 +1,6 @@
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.2.9beta7 - March 7, 2006
+ libpng version 1.2.9beta8 - March 9, 2006
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2005 Glenn Randers-Pehrson
@@ -787,7 +787,7 @@
         png_set_palette_to_rgb(png_ptr);
 
     if (color_type == PNG_COLOR_TYPE_GRAY &&
-        bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
+        bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
 
     if (png_get_valid(png_ptr, info_ptr,
         PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
@@ -797,6 +797,11 @@
 readability.  In some future version they may actually do different
 things.
 
+As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
+added.  It expands the sample depth without changing tRNS to alpha.
+At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
+will be removed from a future version.
+
 PNG can have files with 16 bits per channel.  If you only can handle
 8 bits per channel, this will strip the pixels down to 8 bit.
 
@@ -2904,13 +2909,13 @@
 
 IX. Y2K Compliance in libpng
 
-March 7, 2006
+March 9, 2006
 
 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.2.9beta7 are Y2K compliant.  It is my belief that earlier
+upward through 1.2.9beta8 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/libpngpf.3 b/libpngpf.3
index e9df46e..3c47944 100644
--- a/libpngpf.3
+++ b/libpngpf.3
@@ -1,6 +1,6 @@
-.TH LIBPNGPF 3 "March 7, 2006"
+.TH LIBPNGPF 3 "March 9, 2006"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.2.9beta7
+libpng \- Portable Network Graphics (PNG) Reference Library 1.2.9beta8
 (private functions)
 .SH SYNOPSIS
 \fB#include <png.h>\fP
diff --git a/ltmain.sh b/ltmain.sh
index 8f7a6ac..4988fb9 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -3245,7 +3245,7 @@
 	    age="0"
 	    ;;
 	  irix|nonstopux)
-	    current=`expr $number_major + $number_minor - 1`
+	    current=`expr $number_major + $number_minor`
 	    age="$number_minor"
 	    revision="$number_minor"
 	    ;;
@@ -3320,7 +3320,7 @@
 	  ;;
 
 	irix | nonstopux)
-	  major=`expr $current - $age + 1`
+	  major=`expr $current - $age`
 
 	  case $version_type in
 	    nonstopux) verstring_prefix=nonstopux ;;
diff --git a/png.5 b/png.5
index 8817379..c909d32 100644
--- a/png.5
+++ b/png.5
@@ -1,4 +1,4 @@
-.TH PNG 5 "March 7, 2006"
+.TH PNG 5 "March 9, 2006"
 .SH NAME
 png \- Portable Network Graphics (PNG) format
 .SH DESCRIPTION
diff --git a/png.c b/png.c
index 961bcef..497391e 100644
--- a/png.c
+++ b/png.c
@@ -1,7 +1,7 @@
 
 /* png.c - location for general purpose libpng functions
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -13,7 +13,7 @@
 #include "png.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_2_9beta7 Your_png_h_is_not_version_1_2_9beta7;
+typedef version_1_2_9beta8 Your_png_h_is_not_version_1_2_9beta8;
 
 /* Version information for C files.  This had better match the version
  * string defined in png.h.  */
@@ -289,7 +289,7 @@
  * and applications using it are urged to use png_create_info_struct()
  * instead.
  */
-#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
+#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
 #undef png_info_init
 void PNGAPI
 png_info_init(png_infop info_ptr)
@@ -693,7 +693,7 @@
 png_get_copyright(png_structp png_ptr)
 {
    if (&png_ptr != NULL)  /* silence compiler warning about unused png_ptr */
-   return ((png_charp) "\n libpng version 1.2.9beta7 - March 7, 2006\n\
+   return ((png_charp) "\n libpng version 1.2.9beta8 - March 9, 2006\n\
    Copyright (c) 1998-2006 Glenn Randers-Pehrson\n\
    Copyright (c) 1996-1997 Andreas Dilger\n\
    Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
diff --git a/png.h b/png.h
index 2126dd6..bc2e4bd 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.2.9beta7 - March 7, 2006
+ * libpng version 1.2.9beta8 - March 9, 2006
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -9,7 +9,7 @@
  * Authors and maintainers:
  *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- *  libpng versions 0.97, January 1998, through 1.2.9beta7 - March 7, 2006: Glenn
+ *  libpng versions 0.97, January 1998, through 1.2.9beta8 - March 9, 2006: Glenn
  *  See also "Contributing Authors", below.
  *
  * Note about libpng version numbers:
@@ -113,7 +113,7 @@
  *    1.0.18                  10    10018  12.so.0.1.0.18
  *    1.2.8                   13    10208  12.so.0.1.2.8
  *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3
- *    1.2.9beta4-7            13    10209  12.so.0.9[.0]
+ *    1.2.9beta4-8            13    10209  12.so.0.9[.0]
  *
  *    Henceforth the source version will match the shared-library major
  *    and minor numbers; the shared-library major version number will be
@@ -143,7 +143,7 @@
  * If you modify libpng you may insert additional notices immediately following
  * this sentence.
  *
- * libpng versions 1.2.6, August 15, 2004, through 1.2.9beta7, March 7, 2006, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.2.9beta8, March 9, 2006, are
  * Copyright (c) 2004, 2006 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:
@@ -255,13 +255,13 @@
  * Y2K compliance in libpng:
  * =========================
  *
- *    March 7, 2006
+ *    March 9, 2006
  *
  *    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.2.9beta7 are Y2K compliant.  It is my belief that earlier
+ *    upward through 1.2.9beta8 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
@@ -317,9 +317,9 @@
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.2.9beta7"
+#define PNG_LIBPNG_VER_STRING "1.2.9beta8"
 #define PNG_HEADER_VERSION_STRING \
-   " libpng version 1.2.9beta7 - March 7, 2006 (header)\n"
+   " libpng version 1.2.9beta8 - March 9, 2006 (header)\n"
 
 #define PNG_LIBPNG_VER_SONUM   0
 #define PNG_LIBPNG_VER_DLLNUM  13
@@ -331,7 +331,7 @@
 /* This should match the numeric part of the final component of
  * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
 
-#define PNG_LIBPNG_VER_BUILD  7
+#define PNG_LIBPNG_VER_BUILD  8
 
 /* Release Status */
 #define PNG_LIBPNG_BUILD_ALPHA    1
@@ -1361,7 +1361,7 @@
 /* This triggers a compiler error in png.c, if png.c and png.h
  * do not agree upon the version number.
  */
-typedef png_structp version_1_2_9beta7;
+typedef png_structp version_1_2_9beta8;
 
 typedef png_struct FAR * FAR * png_structpp;
 
@@ -1491,9 +1491,16 @@
 #if defined(PNG_READ_EXPAND_SUPPORTED)
 /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
 extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));
-extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr));
+#if !defined(PNG_1_0_X)
+extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp
+  png_ptr));
+#endif
 extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr));
 extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));
+#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
+/* Deprecated */
+extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp png_ptr));
+#endif
 #endif
 
 #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
@@ -2675,7 +2682,7 @@
 #define PNG_RGB_TO_GRAY      0x600000L  /* two bits, RGB_TO_GRAY_ERR|WARN */
                        /*    0x800000L     Unused */
 #define PNG_ADD_ALPHA       0x1000000L  /* Added to libpng-1.2.7 */
-                       /*   0x2000000L  unused */
+#define PNG_EXPAND_tRNS     0x2000000L  /* Added to libpng-1.2.9 */
                        /*   0x4000000L  unused */
                        /*   0x8000000L  unused */
                        /*  0x10000000L  unused */
diff --git a/pngconf.h b/pngconf.h
index 42eea06..523eba5 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -4,7 +4,7 @@
 #if defined(PNG_1_0_X)
 #endif
 #if defined (PNG_1_2_X)
- * libpng version 1.2.9beta7 - March 7, 2006
+ * libpng version 1.2.9beta8 - March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2005 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngerror.c b/pngerror.c
index c107924..650e8ed 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -1,7 +1,7 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pnggccrd.c b/pnggccrd.c
index 8c4cc9e..8e97449 100644
--- a/pnggccrd.c
+++ b/pnggccrd.c
@@ -7,7 +7,7 @@
  *     and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
  *     for Intel's performance analysis of the MMX vs. non-MMX code.
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * Copyright (c) 1998, Intel Corporation
diff --git a/pngget.c b/pngget.c
index 699f7c3..accba17 100644
--- a/pngget.c
+++ b/pngget.c
@@ -1,7 +1,7 @@
 
 /* pngget.c - retrieval of values from info struct
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngmem.c b/pngmem.c
index 9085d9e..81eb654 100644
--- a/pngmem.c
+++ b/pngmem.c
@@ -1,7 +1,7 @@
 
 /* pngmem.c - stub functions for memory allocation
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngread.c b/pngread.c
index 52679e0..5db2e25 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1,7 +1,7 @@
 
 /* pngread.c - read a PNG file
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -171,7 +171,7 @@
    return (png_ptr);
 }
 
-#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
+#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
 /* Initialize PNG structure for reading, and allocate any memory needed.
    This interface is deprecated in favour of the png_create_read_struct(),
    and it will disappear as of libpng-1.3.0. */
diff --git a/pngrio.c b/pngrio.c
index 6fcac28..54f37ef 100644
--- a/pngrio.c
+++ b/pngrio.c
@@ -1,7 +1,7 @@
 
 /* pngrio.c - functions for data input
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -69,7 +69,7 @@
 #define NEAR_BUF_SIZE 1024
 #define MIN(a,b) (a <= b ? a : b)
 
-static void /* PRIVATE */
+static void PNGAPI
 png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
 {
    int check;
diff --git a/pngrtran.c b/pngrtran.c
index 22b4733..2a03d6e 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,7 +1,7 @@
 
 /* pngrtran.c - transforms the data in a row for PNG readers
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -551,7 +551,7 @@
 png_set_expand(png_structp png_ptr)
 {
    png_debug(1, "in png_set_expand\n");
-   png_ptr->transformations |= PNG_EXPAND;
+   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
 }
 
 /* GRR 19990627:  the following three functions currently are identical
@@ -566,30 +566,47 @@
  *
  *  More to the point, these functions make it obvious what libpng will be
  *  doing, whereas "expand" can (and does) mean any number of things.
+ *
+ *  GRP 20060307: In libpng-1.4.0, png_set_gray_1_2_4_to_8() was modified
+ *  to expand only the sample depth but not to expand the tRNS to alpha.
  */
 
 /* Expand paletted images to RGB. */
 void PNGAPI
 png_set_palette_to_rgb(png_structp png_ptr)
 {
-   png_debug(1, "in png_set_expand\n");
-   png_ptr->transformations |= PNG_EXPAND;
+   png_debug(1, "in png_set_palette_to_rgb\n");
+   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
 }
 
+#if !defined(PNG_1_0_X)
 /* Expand grayscale images of less than 8-bit depth to 8 bits. */
 void PNGAPI
+png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
+{
+   png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n");
+   png_ptr->transformations |= PNG_EXPAND_tRNS;
+}
+#endif
+
+#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
+/* Expand grayscale images of less than 8-bit depth to 8 bits. */
+/* Deprecated as of libpng-1.2.9 */
+void PNGAPI
 png_set_gray_1_2_4_to_8(png_structp png_ptr)
 {
-   png_debug(1, "in png_set_expand\n");
-   png_ptr->transformations |= PNG_EXPAND;
+   png_debug(1, "in png_set_gray_1_2_4_to_8\n");
+   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
 }
+#endif
+
 
 /* Expand tRNS chunks to alpha channels. */
 void PNGAPI
 png_set_tRNS_to_alpha(png_structp png_ptr)
 {
    png_debug(1, "in png_set_expand\n");
-   png_ptr->transformations |= PNG_EXPAND;
+   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
 }
 #endif /* defined(PNG_READ_EXPAND_SUPPORTED) */
 
@@ -707,23 +724,41 @@
    {
       if (!(color_type & PNG_COLOR_MASK_COLOR))  /* i.e., GRAY or GRAY_ALPHA */
       {
-         /* expand background chunk. */
+         /* expand background and tRNS chunks */
          switch (png_ptr->bit_depth)
          {
             case 1:
                png_ptr->background.gray *= (png_uint_16)0xff;
                png_ptr->background.red = png_ptr->background.green
                  =  png_ptr->background.blue = png_ptr->background.gray;
+               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
+               {
+                 png_ptr->trans_values.gray *= (png_uint_16)0xff;
+                 png_ptr->trans_values.red = png_ptr->trans_values.green
+                   = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
+               }
                break;
             case 2:
                png_ptr->background.gray *= (png_uint_16)0x55;
                png_ptr->background.red = png_ptr->background.green
                  = png_ptr->background.blue = png_ptr->background.gray;
+               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
+               {
+                 png_ptr->trans_values.gray *= (png_uint_16)0x55;
+                 png_ptr->trans_values.red = png_ptr->trans_values.green
+                   = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
+               }
                break;
             case 4:
                png_ptr->background.gray *= (png_uint_16)0x11;
                png_ptr->background.red = png_ptr->background.green
                  = png_ptr->background.blue = png_ptr->background.gray;
+               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
+               {
+                 png_ptr->trans_values.gray *= (png_uint_16)0x11;
+                 png_ptr->trans_values.red = png_ptr->trans_values.green
+                   = png_ptr->trans_values.blue = png_ptr->trans_values.gray;
+               }
                break;
             case 8:
             case 16:
@@ -745,7 +780,7 @@
         if (png_ptr->transformations & PNG_INVERT_ALPHA)
         {
 #if defined(PNG_READ_EXPAND_SUPPORTED)
-           if (!(png_ptr->transformations & PNG_EXPAND))
+           if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
 #endif
            {
            /* invert the alpha channel (in tRNS) unless the pixels are
@@ -1045,7 +1080,7 @@
    {
       if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
       {
-         if (png_ptr->num_trans)
+         if (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND_tRNS))
             info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
          else
             info_ptr->color_type = PNG_COLOR_TYPE_RGB;
@@ -1055,7 +1090,12 @@
       else
       {
          if (png_ptr->num_trans)
-            info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
+         {
+            if (png_ptr->transformations & PNG_EXPAND_tRNS)
+              info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
+            else
+              info_ptr->color_type |= PNG_COLOR_MASK_COLOR;
+         }
          if (info_ptr->bit_depth < 8)
             info_ptr->bit_depth = 8;
          info_ptr->num_trans = 0;
@@ -1201,7 +1241,7 @@
       }
       else
       {
-         if (png_ptr->num_trans)
+         if (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND_tRNS))
             png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1,
                &(png_ptr->trans_values));
          else
@@ -3604,8 +3644,8 @@
    }
 }
 
-/* If the bit depth < 8, it is expanded to 8.  Also, if the
- * transparency value is supplied, an alpha channel is built.
+/* If the bit depth < 8, it is expanded to 8.  Also, if the already
+ * expanded transparency value is supplied, an alpha channel is built.
  */
 void /* PRIVATE */
 png_do_expand(png_row_infop row_info, png_bytep row,
diff --git a/pngrutil.c b/pngrutil.c
index f6d6f87..c8b5b88 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -1,7 +1,7 @@
 
 /* pngrutil.c - utilities to read a PNG file
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngset.c b/pngset.c
index 57fea04..171f721 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,7 +1,7 @@
 
 /* pngset.c - storage of image information into info struct
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -1052,7 +1052,7 @@
 }
 #endif
 
-#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
+#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
 #if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
     defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
 void PNGAPI
diff --git a/pngtest.c b/pngtest.c
index 6005627..8511121 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1551,4 +1551,4 @@
 }
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_2_9beta7 your_png_h_is_not_version_1_2_9beta7;
+typedef version_1_2_9beta8 your_png_h_is_not_version_1_2_9beta8;
diff --git a/pngtrans.c b/pngtrans.c
index 60e52ae..9e6ef8a 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -1,7 +1,7 @@
 
 /* pngtrans.c - transforms the data in a row (used by both readers and writers)
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngwrite.c b/pngwrite.c
index 9ebf836..e7817f2 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,7 +1,7 @@
 
 /* pngwrite.c - general routines to write a PNG file
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -554,7 +554,7 @@
 }
 
 /* Initialize png_ptr structure, and allocate any memory needed */
-#if defined(PNG_1_0_X) || defined (PNG_1_2_X)
+#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
 /* Deprecated. */
 #undef png_write_init
 void PNGAPI
diff --git a/pngwtran.c b/pngwtran.c
index da8b853..3165109 100644
--- a/pngwtran.c
+++ b/pngwtran.c
@@ -1,7 +1,7 @@
 
 /* pngwtran.c - transforms the data in a row for PNG writers
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngwutil.c b/pngwutil.c
index 8cf3d2c..d97ff63 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1,7 +1,7 @@
 
 /* pngwutil.c - utilities to write a PNG file
  *
- * Last changed in libpng 1.2.9 March 7, 2006
+ * Last changed in libpng 1.2.9 March 9, 2006
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2006 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/scripts/libpng-config-head.in b/scripts/libpng-config-head.in
index ea593eb..221d3da 100755
--- a/scripts/libpng-config-head.in
+++ b/scripts/libpng-config-head.in
@@ -8,7 +8,7 @@
 
 # Modeled after libxml-config.
 
-version=1.2.9beta7
+version=1.2.9beta8
 prefix=""
 libdir=""
 libs=""
diff --git a/scripts/makefile.32sunu b/scripts/makefile.32sunu
index 37ab668..90daa53 100644
--- a/scripts/makefile.32sunu
+++ b/scripts/makefile.32sunu
@@ -7,7 +7,7 @@
 
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 CC=cc
@@ -126,8 +126,8 @@
 	./pngtest
 
 install-headers: png.h pngconf.h
-	-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
 	cp png.h pngconf.h $(DI)/$(LIBNAME)
 	chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
 	-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
@@ -135,7 +135,7 @@
 	(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
 
 install-static: install-headers libpng.a
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	cp libpng.a $(DL)/$(LIBNAME).a
 	chmod 644 $(DL)/$(LIBNAME).a
 	-@$(RM_F) $(DL)/libpng.a
@@ -143,7 +143,7 @@
 
 install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
 	libpng.so.0.$(PNGMIN)
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGMAJ)
 	-@$(RM_F) $(DL)/$(LIBNAME).so
@@ -159,7 +159,7 @@
 	$(LN_SF) libpng.so.0 libpng.so; \
 	$(LN_SF) $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	$(LN_SF) $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-	-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
+	-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 	-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
 	-@$(RM_F) $(DL)/pkgconfig/libpng.pc
 	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
@@ -167,18 +167,18 @@
 	(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
 
 install-man: libpng.3 libpngpf.3 png.5
-	-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-	-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
+	-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 	-@$(RM_F) $(DM)/man3/libpng.3
 	-@$(RM_F) $(DM)/man3/libpngpf.3
 	cp libpng.3 $(DM)/man3
 	cp libpngpf.3 $(DM)/man3
-	-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
+	-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 	-@$(RM_F) $(DM)/man5/png.5
 	cp png.5 $(DM)/man5
 
 install-config: libpng-config
-	-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
+	-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 	-@$(RM_F) $(DB)/libpng-config
 	-@$(RM_F) $(DB)/$(LIBNAME)-config
 	cp libpng-config $(DB)/$(LIBNAME)-config
diff --git a/scripts/makefile.64sunu b/scripts/makefile.64sunu
index 764ec32..577bc5e 100644
--- a/scripts/makefile.64sunu
+++ b/scripts/makefile.64sunu
@@ -7,7 +7,7 @@
 
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 CC=cc
@@ -126,8 +126,8 @@
 	./pngtest
 
 install-headers: png.h pngconf.h
-	-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
 	cp png.h pngconf.h $(DI)/$(LIBNAME)
 	chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
 	-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
@@ -135,7 +135,7 @@
 	(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
 
 install-static: install-headers libpng.a
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	cp libpng.a $(DL)/$(LIBNAME).a
 	chmod 644 $(DL)/$(LIBNAME).a
 	-@$(RM_F) $(DL)/libpng.a
@@ -143,7 +143,7 @@
 
 install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
 	libpng.so.0.$(PNGMIN)
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGMAJ)
 	-@$(RM_F) $(DL)/$(LIBNAME).so
@@ -159,7 +159,7 @@
 	$(LN_SF) libpng.so.0 libpng.so; \
 	$(LN_SF) $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	$(LN_SF) $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-	-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
+	-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 	-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
 	-@$(RM_F) $(DL)/pkgconfig/libpng.pc
 	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
@@ -167,18 +167,18 @@
 	(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
 
 install-man: libpng.3 libpngpf.3 png.5
-	-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-	-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
+	-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 	-@$(RM_F) $(DM)/man3/libpng.3
 	-@$(RM_F) $(DM)/man3/libpngpf.3
 	cp libpng.3 $(DM)/man3
 	cp libpngpf.3 $(DM)/man3
-	-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
+	-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 	-@$(RM_F) $(DM)/man5/png.5
 	cp png.5 $(DM)/man5
 
 install-config: libpng-config
-	-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
+	-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 	-@$(RM_F) $(DB)/libpng-config
 	-@$(RM_F) $(DB)/$(LIBNAME)-config
 	cp libpng-config $(DB)/$(LIBNAME)-config
diff --git a/scripts/makefile.aix b/scripts/makefile.aix
index 6687db9..08d883a 100644
--- a/scripts/makefile.aix
+++ b/scripts/makefile.aix
@@ -13,13 +13,14 @@
 CC = gcc
 LD = $(CC)
 AR_RC = ar rcs
+MKDIR_P = mkdir
 RANLIB = ranlib
 RM_F = rm -f
 LN_SF = ln -f -s
 
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 prefix=/usr/local
@@ -71,9 +72,9 @@
 	$(LD) -o $@ pngtest$(O) $(LDFLAGS)
 
 install: $(LIBNAME)$(A)
-	-@if [ ! -d $(DI)  ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME)  ]; then mkdir $(DI)/$(LIBNAME); fi
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DI)  ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME)  ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@$(RM_F) $(DI)/$(LIBNAME)/png.h
 	-@$(RM_F) $(DI)/$(LIBNAME)/pngconf.h
 	-@$(RM_F) $(DI)/png.h
diff --git a/scripts/makefile.beos b/scripts/makefile.beos
index 439dc97..7b27f85 100644
--- a/scripts/makefile.beos
+++ b/scripts/makefile.beos
@@ -17,7 +17,7 @@
 ZLIBINC=/usr/local/include
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 ALIGN=
diff --git a/scripts/makefile.cygwin b/scripts/makefile.cygwin
index 4c81c91..8c2714f 100644
--- a/scripts/makefile.cygwin
+++ b/scripts/makefile.cygwin
@@ -80,7 +80,7 @@
 LIBNAME = libpng12
 PNGMAJ = 0
 CYGDLL = 12
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 SHAREDLIB=cygpng$(CYGDLL).dll
diff --git a/scripts/makefile.darwin b/scripts/makefile.darwin
index fdcaa8c..5e3ecf8 100644
--- a/scripts/makefile.darwin
+++ b/scripts/makefile.darwin
@@ -27,7 +27,7 @@
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -108,8 +108,8 @@
 	./pngtest
 
 install-headers: png.h pngconf.h
-	-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
 	cp png.h pngconf.h $(DI)/$(LIBNAME)
 	chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
 	-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
@@ -117,7 +117,7 @@
 	(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
 
 install-static: install-headers libpng.a
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	cp libpng.a $(DL)/$(LIBNAME).a
 	chmod 644 $(DL)/$(LIBNAME).a
 	$(RANLIB) $(DL)/$(LIBNAME).a
@@ -126,7 +126,7 @@
 
 install-shared: install-headers $(LIBNAME).dylib libpng.pc \
 	libpng.3.$(PNGMIN).dylib
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@$(RM_F) $(DL)/$(LIBNAME).$(PNGVER)*.dylib
 	-@$(RM_F) $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib
 	-@$(RM_F) $(DL)/$(LIBNAME).dylib
@@ -142,7 +142,7 @@
 	$(LN_SF) libpng.3.dylib libpng.dylib; \
 	$(LN_SF) $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \
 	$(LN_SF) $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib)
-	-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
+	-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 	-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
 	-@$(RM_F) $(DL)/pkgconfig/libpng.pc
 	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
@@ -150,18 +150,18 @@
 	(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
 
 install-man: libpng.3 libpngpf.3 png.5
-	-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-	-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
+	-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 	-@$(RM_F) $(DM)/man3/libpng.3
 	-@$(RM_F) $(DM)/man3/libpngpf.3
 	cp libpng.3 $(DM)/man3
 	cp libpngpf.3 $(DM)/man3
-	-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
+	-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 	-@$(RM_F) $(DM)/man5/png.5
 	cp png.5 $(DM)/man5
 
 install-config: libpng-config
-	-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
+	-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 	-@$(RM_F) $(DB)/libpng-config
 	-@$(RM_F) $(DB)/$(LIBNAME)-config
 	cp libpng-config $(DB)/$(LIBNAME)-config
diff --git a/scripts/makefile.dec b/scripts/makefile.dec
index 904b00c..a7e4744 100644
--- a/scripts/makefile.dec
+++ b/scripts/makefile.dec
@@ -33,7 +33,7 @@
 ZLIBINC=../zlib
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -91,8 +91,8 @@
 	./pngtest
 
 install-headers: png.h pngconf.h
-	-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
 	cp png.h pngconf.h $(DI)/$(LIBNAME)
 	chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
@@ -100,7 +100,7 @@
 	(cd $(DI); $(LN_SF)(LIBNAME) libpng; $(LN_SF)(LIBNAME)/* .)
 
 install-static: install-headers libpng.a
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	cp libpng.a $(DL)/$(LIBNAME).a
 	chmod 644 $(DL)/$(LIBNAME).a
 	-@/bin/rm -f $(DL)/libpng.a
@@ -108,7 +108,7 @@
 
 install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
 	libpng.so.0.$(PNGMIN)
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
 	-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)
 	-@/bin/rm -f $(DL)/libpng.so
@@ -123,7 +123,7 @@
 	$(LN_SF) libpng.so.0 libpng.so; \
 	$(LN_SF)(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	$(LN_SF)(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-	-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
+	-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 	-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
 	-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
 	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
@@ -131,18 +131,18 @@
 	(cd $(DL)/pkgconfig; $(LN_SF)(LIBNAME).pc libpng.pc)
 
 install-man: libpng.3 libpngpf.3 png.5
-	-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-	-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
+	-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 	-@/bin/rm -f $(DM)/man3/libpng.3
 	-@/bin/rm -f $(DM)/man3/libpngpf.3
 	cp libpng.3 $(DM)/man3
 	cp libpngpf.3 $(DM)/man3
-	-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
+	-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 	-@/bin/rm -f $(DM)/man5/png.5
 	cp png.5 $(DM)/man5
 
 install-config: libpng-config
-	-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
+	-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 	-@/bin/rm -f $(DB)/libpng-config
 	-@/bin/rm -f $(DB)/$(LIBNAME)-config
 	cp libpng-config $(DB)/$(LIBNAME)-config
diff --git a/scripts/makefile.elf b/scripts/makefile.elf
index 6c1f10a..20dd781 100644
--- a/scripts/makefile.elf
+++ b/scripts/makefile.elf
@@ -11,7 +11,7 @@
 
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 AR_RC=ar rc
diff --git a/scripts/makefile.gcmmx b/scripts/makefile.gcmmx
index 96fb8a8..63577e7 100644
--- a/scripts/makefile.gcmmx
+++ b/scripts/makefile.gcmmx
@@ -15,7 +15,7 @@
 
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Compiler, linker, lib and other tools
diff --git a/scripts/makefile.hp64 b/scripts/makefile.hp64
index b5c80a4..f5f2d4c 100644
--- a/scripts/makefile.hp64
+++ b/scripts/makefile.hp64
@@ -32,7 +32,7 @@
 
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
diff --git a/scripts/makefile.hpgcc b/scripts/makefile.hpgcc
index 206f5f0..8194ef4 100644
--- a/scripts/makefile.hpgcc
+++ b/scripts/makefile.hpgcc
@@ -44,7 +44,7 @@
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux
index 635bfe2..b2ed0f1 100644
--- a/scripts/makefile.hpux
+++ b/scripts/makefile.hpux
@@ -28,7 +28,7 @@
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
diff --git a/scripts/makefile.linux b/scripts/makefile.linux
index 88948df..9e00828 100644
--- a/scripts/makefile.linux
+++ b/scripts/makefile.linux
@@ -5,7 +5,7 @@
 
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 AR_RC=ar rc
diff --git a/scripts/makefile.ne12bsd b/scripts/makefile.ne12bsd
index e93e020..0b6fe50 100644
--- a/scripts/makefile.ne12bsd
+++ b/scripts/makefile.ne12bsd
@@ -13,7 +13,7 @@
 
 LIB=	png12
 SHLIB_MAJOR=	0
-SHLIB_MINOR=	1.2.9beta7
+SHLIB_MINOR=	1.2.9beta8
 SRCS=	pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
 		pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
 		pngwtran.c pngmem.c pngerror.c pngpread.c
diff --git a/scripts/makefile.netbsd b/scripts/makefile.netbsd
index 9cf8bf1..e67cdf9 100644
--- a/scripts/makefile.netbsd
+++ b/scripts/makefile.netbsd
@@ -13,7 +13,7 @@
 
 LIB=	png
 SHLIB_MAJOR=	3
-SHLIB_MINOR=	1.2.9beta7
+SHLIB_MINOR=	1.2.9beta8
 SRCS=	pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
 		pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
 		pngwtran.c pngmem.c pngerror.c pngpread.c
diff --git a/scripts/makefile.openbsd b/scripts/makefile.openbsd
index 78ccb66..963fabf 100644
--- a/scripts/makefile.openbsd
+++ b/scripts/makefile.openbsd
@@ -7,7 +7,7 @@
 MANDIR= ${PREFIX}/man/cat
 
 SHLIB_MAJOR=	0
-SHLIB_MINOR=	1.2.9beta7
+SHLIB_MINOR=	1.2.9beta8
 
 LIB=	png
 SRCS=	png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
diff --git a/scripts/makefile.sco b/scripts/makefile.sco
index 14c2685..43fb560 100644
--- a/scripts/makefile.sco
+++ b/scripts/makefile.sco
@@ -27,7 +27,7 @@
 LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -102,8 +102,8 @@
 	./pngtest
 
 install-headers: png.h pngconf.h
-	-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
 	-@$(RM_F) $(DI)/png.h
 	-@$(RM_F) $(DI)/pngconf.h
 	cp png.h pngconf.h $(DI)/$(LIBNAME)
@@ -113,7 +113,7 @@
 	(cd $(DI); $(LN_FS) $(LIBNAME) libpng; $(LN_FS) $(LIBNAME)/* .)
 
 install-static: install-headers libpng.a
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	cp libpng.a $(DL)/$(LIBNAME).a
 	chmod 644 $(DL)/$(LIBNAME).a
 	-@$(RM_F) $(DL)/libpng.a
@@ -121,7 +121,7 @@
 
 install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
 	libpng.so.0.$(PNGMIN)
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGMAJ)
 	-@$(RM_F) $(DL)/libpng.so
@@ -136,7 +136,7 @@
 	$(LN_FS) libpng.so.0 libpng.so; \
 	$(LN_FS) $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	$(LN_FS) $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-	-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
+	-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 	-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
 	-@$(RM_F) $(DL)/pkgconfig/libpng.pc
 	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
@@ -144,18 +144,18 @@
 	(cd $(DL)/pkgconfig; $(LN_FS) $(LIBNAME).pc libpng.pc)
 
 install-man: libpng.3 libpngpf.3 png.5
-	-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-	-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
+	-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 	-@$(RM_F) $(DM)/man3/libpng.3
 	-@$(RM_F) $(DM)/man3/libpngpf.3
 	cp libpng.3 $(DM)/man3
 	cp libpngpf.3 $(DM)/man3
-	-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
+	-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 	-@$(RM_F) $(DM)/man5/png.5
 	cp png.5 $(DM)/man5
 
 install-config: libpng-config
-	-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
+	-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 	-@$(RM_F) $(DB)/libpng-config
 	-@$(RM_F) $(DB)/$(LIBNAME)-config
 	cp libpng-config $(DB)/$(LIBNAME)-config
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index d1cc492..63f2af2 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -19,7 +19,7 @@
 
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 AR_RC=ar rc
@@ -115,8 +115,8 @@
 	./pngtest
 
 install-headers: png.h pngconf.h
-	-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
 	cp png.h pngconf.h $(DI)/$(LIBNAME)
 	chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
 	-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
@@ -124,7 +124,7 @@
 	(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
 
 install-static: install-headers libpng.a
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	cp libpng.a $(DL)/$(LIBNAME).a
 	chmod 644 $(DL)/$(LIBNAME).a
 	-@$(RM_F) $(DL)/libpng.a
@@ -132,7 +132,7 @@
 
 install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
 	libpng.so.0.$(PNGMIN)
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGMAJ)
 	-@$(RM_F) $(DL)/libpng.so
@@ -147,7 +147,7 @@
 	ln -sf libpng.so.0 libpng.so; \
 	ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-	-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
+	-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 	-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
 	-@$(RM_F) $(DL)/pkgconfig/libpng.pc
 	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
@@ -155,18 +155,18 @@
 	(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
 
 install-man: libpng.3 libpngpf.3 png.5
-	-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-	-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
+	-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 	-@$(RM_F) $(DM)/man3/libpng.3
 	-@$(RM_F) $(DM)/man3/libpngpf.3
 	cp libpng.3 $(DM)/man3
 	cp libpngpf.3 $(DM)/man3
-	-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
+	-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 	-@$(RM_F) $(DM)/man5/png.5
 	cp png.5 $(DM)/man5
 
 install-config: libpng-config
-	-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
+	-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 	-@$(RM_F) $(DB)/libpng-config
 	-@$(RM_F) $(DB)/$(LIBNAME)-config
 	cp libpng-config $(DB)/$(LIBNAME)-config
@@ -200,7 +200,7 @@
 	./pngtesti pngtest.png
 
 clean:
-	$(RM_F)libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
+	$(RM_F) libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
 	$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
 	libpng.so.0.$(PNGMIN) \
 	so_locations
diff --git a/scripts/makefile.sgi b/scripts/makefile.sgi
index 3128f8c..c0eafda 100644
--- a/scripts/makefile.sgi
+++ b/scripts/makefile.sgi
@@ -5,7 +5,7 @@
 
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Where make install puts libpng.a, libpng12.so, and libpng12/png.h
diff --git a/scripts/makefile.so9 b/scripts/makefile.so9
index 6fef3e7..70fe48f 100644
--- a/scripts/makefile.so9
+++ b/scripts/makefile.so9
@@ -9,7 +9,7 @@
 # gcc 2.95 doesn't work.
 CC=cc
 AR_RC=ar rc
-MKDIR_P=mkdir
+MKDIR_P=mkdir -p
 LN_SF=ln -f -s
 RANLIB=echo
 RM_F=/bin/rm -f
@@ -37,7 +37,7 @@
 LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -124,8 +124,8 @@
 	./pngtest
 
 install-headers: png.h pngconf.h
-	-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
-	-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
+	-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
 	cp png.h pngconf.h $(DI)/$(LIBNAME)
 	chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
 	-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
@@ -133,7 +133,7 @@
 	(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
 
 install-static: install-headers libpng.a
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	cp libpng.a $(DL)/$(LIBNAME).a
 	chmod 644 $(DL)/$(LIBNAME).a
 	-@$(RM_F) $(DL)/libpng.a
@@ -141,7 +141,7 @@
 
 install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \
 	libpng.so.0.$(PNGMIN)
-	-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
+	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so
 	-@$(RM_F) $(DL)/$(LIBNAME).so.$(PNGMAJ)
 	-@$(RM_F) $(DL)/libpng.so
@@ -156,7 +156,7 @@
 	$(LN_SF) libpng.so.0 libpng.so; \
 	$(LN_SF) $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	$(LN_SF) $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-	-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
+	-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
 	-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
 	-@$(RM_F) $(DL)/pkgconfig/libpng.pc
 	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
@@ -164,18 +164,18 @@
 	(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
 
 install-man: libpng.3 libpngpf.3 png.5
-	-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
-	-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
+	-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
 	-@$(RM_F) $(DM)/man3/libpng.3
 	-@$(RM_F) $(DM)/man3/libpngpf.3
 	cp libpng.3 $(DM)/man3
 	cp libpngpf.3 $(DM)/man3
-	-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
+	-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
 	-@$(RM_F) $(DM)/man5/png.5
 	cp png.5 $(DM)/man5
 
 install-config: libpng-config
-	-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
+	-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
 	-@$(RM_F) $(DB)/libpng-config
 	-@$(RM_F) $(DB)/$(LIBNAME)-config
 	cp libpng-config $(DB)/$(LIBNAME)-config
diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris
index 4ccb892..f2b4c2c 100644
--- a/scripts/makefile.solaris
+++ b/scripts/makefile.solaris
@@ -7,7 +7,7 @@
 
 AR_RC=ar rc
 CC=gcc
-MKDIR_P=mkdir
+MKDIR_P=mkdir -p
 LN_SF=ln -f -s
 RANLIB=echo
 RM_F=/bin/rm -f
@@ -33,7 +33,7 @@
 LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
 
 PNGMAJ = 0
-PNGMIN = 1.2.9beta7
+PNGMIN = 1.2.9beta8
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
diff --git a/scripts/makefile.sunos b/scripts/makefile.sunos
index 241224c..ff19591 100644
--- a/scripts/makefile.sunos
+++ b/scripts/makefile.sunos
@@ -31,7 +31,7 @@
 
 CC=gcc
 AR_RC=ar rc
-MKDIR_P=mkdir
+MKDIR_P=mkdir -p
 LN_SF=ln -f -s
 RANLIB=ranlib
 RM_F=/bin/rm -f
diff --git a/scripts/pngos2.def b/scripts/pngos2.def
index 68f563b..f26f242 100644
--- a/scripts/pngos2.def
+++ b/scripts/pngos2.def
@@ -2,7 +2,7 @@
 ; PNG.LIB module definition file for OS/2
 ;----------------------------------------
 
-; Version 1.2.9beta7
+; Version 1.2.9beta8
 
 LIBRARY		PNG
 DESCRIPTION	"PNG image compression library for OS/2"
@@ -118,7 +118,7 @@
   png_set_gAMA
   png_set_gAMA_fixed
   png_set_gamma
-  png_set_gray_1_2_4_to_8
+  png_set_gray_1_2_4_to_8 ; deprecated as of libpng-1.2.9
   png_set_gray_to_rgb
   png_set_hIST
   png_set_iCCP
@@ -221,6 +221,7 @@
   png_get_int_32
   png_save_int_32
   png_get_uint_31
+  png_set_expand_gray_1_2_4_to_8
 
 ; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS
   png_libpng_ver
diff --git a/scripts/pngw32.def b/scripts/pngw32.def
index 0177fc3..fca2e1f 100644
--- a/scripts/pngw32.def
+++ b/scripts/pngw32.def
@@ -5,7 +5,7 @@
 LIBRARY
 
 EXPORTS
-;Version 1.2.9beta7
+;Version 1.2.9beta8
   png_build_grayscale_palette  @1
   png_check_sig        @2
   png_chunk_error      @3
@@ -114,7 +114,7 @@
   png_set_gAMA    @104
   png_set_gAMA_fixed  @105
   png_set_gamma    @106
-  png_set_gray_1_2_4_to_8  @107
+  png_set_gray_1_2_4_to_8  @107 ; deprecated
   png_set_gray_to_rgb  @108
   png_set_hIST    @109
   png_set_iCCP    @110
@@ -232,3 +232,4 @@
   png_get_int_32 @204
   png_save_int_32 @205
   png_get_uint_31 @206
+  png_set_expand_gray_1_2_4_to_8  @207