about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-06-30 19:41:51 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-06-30 19:41:51 +0000
commit81fecd2b0abfba11fbd934b372fed659977c11c6 (patch)
tree289b169b91e3ad4027f216bd841a35033cc1c8b6
parente722d4426fa43a12dcba8369808b28af4e38b526 (diff)
downloadnetpbm-mirror-81fecd2b0abfba11fbd934b372fed659977c11c6.tar.gz
netpbm-mirror-81fecd2b0abfba11fbd934b372fed659977c11c6.tar.xz
netpbm-mirror-81fecd2b0abfba11fbd934b372fed659977c11c6.zip
Release 10.73.36
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@4122 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pamtogif.c4
-rw-r--r--converter/other/pamtopng.c29
-rw-r--r--doc/HISTORY24
-rw-r--r--lib/util/nstring.c28
-rw-r--r--version.mk2
5 files changed, 57 insertions, 30 deletions
diff --git a/converter/other/pamtogif.c b/converter/other/pamtogif.c
index aabf7fc2..d20fa650 100644
--- a/converter/other/pamtogif.c
+++ b/converter/other/pamtogif.c
@@ -95,9 +95,9 @@ pamAlphaPlane(struct pam * const pamP) {
     if (streq(pamP->tuple_type, "RGB_ALPHA"))
         alphaPlane = 3;
     else if (streq(pamP->tuple_type, "GRAYSCALE_ALPHA"))
-        alphaPlane = 2;
+        alphaPlane = 1;
     else if (streq(pamP->tuple_type, "BLACKANDWHITE_ALPHA"))
-        alphaPlane = 2;
+        alphaPlane = 1;
     else
         alphaPlane = 0;
     
diff --git a/converter/other/pamtopng.c b/converter/other/pamtopng.c
index fdeb6582..21161035 100644
--- a/converter/other/pamtopng.c
+++ b/converter/other/pamtopng.c
@@ -61,8 +61,8 @@ static bool verbose;
 struct CmdlineInfo {
     const char * inputFileName;
     unsigned int verbose;
-    unsigned int transparencySpec;
-    const char * transparency;
+    unsigned int transparentSpec;
+    const char * transparent;
     unsigned int chromaSpec;
     struct pngx_chroma chroma;
     unsigned int gammaSpec;
@@ -205,8 +205,8 @@ parseCommandLine (int                  argc,
 
     OPTENT3(0,  "verbose",      OPT_FLAG,       NULL,
             &cmdlineP->verbose,        0);
-    OPTENT3(0,  "transparency", OPT_STRING,     &cmdlineP->transparency,
-            &cmdlineP->transparencySpec, 0);
+    OPTENT3(0,  "transparent", OPT_STRING,      &cmdlineP->transparent,
+            &cmdlineP->transparentSpec, 0);
     OPTENT3(0,  "chroma",       OPT_STRING,     &chroma,
             &cmdlineP->chromaSpec,     0);
     OPTENT3(0,  "gamma",        OPT_FLOAT,      &cmdlineP->gamma,
@@ -296,7 +296,17 @@ colorTypeFromInputType(const struct pam * const pamP) {
             pm_error("Input tuple type is GRAYSCALE, "
                      "but number of planes is %u instead of 1",
                      pamP->depth);
-    } else if (strneq(pamP->tuple_type, "BLACKANDWHITE", 3)) {
+     } else if (strneq(pamP->tuple_type, "BLACKANDWHITE_ALPHA", 19)) {
+        if (pamP->depth != 2)
+            pm_error("Input tuple type is BLACKANDWHITE_ALPHA, "
+                     "but number of planes is %u instead of 2",
+                     pamP->depth);
+        if (pamP->maxval != 1)
+            pm_error("Input tuple type is BLACKANDWHITE_ALPHA, "
+                     "but maxval is %u instead of 1", (unsigned)pamP->maxval);
+
+        retval = PNG_COLOR_TYPE_GRAY_ALPHA;
+    } else if (strneq(pamP->tuple_type, "BLACKANDWHITE", 13)) {
         if (pamP->depth != 1)
             pm_error("Input tuple type is BLACKANDWHITE, "
                      "but number of planes is %u instead of 1",
@@ -410,7 +420,7 @@ doTrnsChunk(const struct pam * const pamP,
     else {
         xelval const pngMaxval = pm_bitstomaxval(pngx_bitDepth(pngxP));
         png_color_16 const pngColor = parseAndScaleColor(trans, pngMaxval);
-            /* Transparency color from text format scaled from 16-bit to
+            /* Transparent color from text format scaled from 16-bit to
                maxval.
             */
 
@@ -687,7 +697,8 @@ writePng(const struct pam * const pamP,
 
 
     if ((pngColorType == PNG_COLOR_TYPE_RGB ||
-         pngColorType == PNG_COLOR_TYPE_RGB_ALPHA) &&
+         pngColorType == PNG_COLOR_TYPE_RGB_ALPHA ||
+         pngColorType == PNG_COLOR_TYPE_GRAY_ALPHA) &&
         pnmBitDepth < 8) {
 
         pngBitDepth = 8;
@@ -704,8 +715,8 @@ writePng(const struct pam * const pamP,
     sBit = sigBitsFmImgType(pnmBitDepth, pngColorType);
 
     /* Where requested, add ancillary chunks */
-    if (cmdline.transparencySpec)
-        doTrnsChunk(pamP, pngxP,cmdline.transparency);
+    if (cmdline.transparentSpec)
+        doTrnsChunk(pamP, pngxP,cmdline.transparent);
 
     if (cmdline.chromaSpec)
         doChrmChunk(pngxP, cmdline.chroma);
diff --git a/doc/HISTORY b/doc/HISTORY
index 4f5542ea..1933249a 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,30 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+21.06.30 BJH  Release 20.73.36
+
+              pamtopng: Fix rejection of all BLACKANDWHITE_ALPHA images with
+              message about wrong depth.  Always broken (pamtopng was new in
+              Netpbm 10.71 (June 2015)).  Thanks Karol Kosek
+              <krkk@krkk.ct8.pl>.
+
+              pamtopng: Fix failure with GRAYSCALE_ALPHA images with maxval
+              less than 255.  Always broken (pamtopng was new in Netpbm 10.71
+              (June 2015)).  Thanks Karol Kosek <krkk@krkk.ct8.pl>.
+              
+              pamtopng: Fix: treats all tuple types that start with BLA as
+              BLACKANDWHITE.  Always broken (pamtopng was new in Netpbm 10.71
+              (June 2015)).
+
+              pamtopng: Fix -transparent option - program recognized
+              -transparency instead.  Always broken (pamtopng was new in
+              Netpbm 10.71 (June 2015)).
+
+              pamtogif: Fix failure with bogus message about wrong depth with
+              grayscale and black and white PAM images with transparency.
+              Always broken (pamtogif was new in Netpbm 10.37 (December 2006)).
+              Thanks Karol Kosek <krkk@krkk.ct8.pl>.
+
 21.03.27 BJH  Release 10.73.35
 
               pamscale: fix bogus "bad magic number" or similar failure most
diff --git a/lib/util/nstring.c b/lib/util/nstring.c
index 711cfca9..093cf99f 100644
--- a/lib/util/nstring.c
+++ b/lib/util/nstring.c
@@ -6,25 +6,17 @@
    Bryan got the base from 
    http://www.ijs.si/software/snprintf/snprintf-2.2.tar.gz, but made
    a lot of changes and additions.
+   The code from ww.ijs.si was written by
+
+     Mark Martinec <mark.martinec@ijs.si>
+
+   in April 1999 and June 2000.  Martinec claims copyright as of 1999, 2000,
+   2001, and 2002 and licenses the code to Netpbm maintainers and users (as
+   members of the public) under the GNU General Public License.
+
+   All other authors likewise license this code to the public under the
+   GNU General Public license.
 
- * AUTHOR
- *   Mark Martinec <mark.martinec@ijs.si>, April 1999.
- *
- *   Copyright 1999, Mark Martinec. All rights reserved.
- *
- * TERMS AND CONDITIONS
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the "Frontier Artistic License" which comes
- *   with this Kit.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty
- *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *   See the Frontier Artistic License for more details.
- *
- *   You should have received a copy of the Frontier Artistic License
- *   with this Kit in the file named LICENSE.txt .
- *   If not, I'll be glad to provide one.
  *
  * FEATURES
  * - careful adherence to specs regarding flags, field width and precision;
diff --git a/version.mk b/version.mk
index e3b2496f..b7578e76 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 73
-NETPBM_POINT_RELEASE = 35
+NETPBM_POINT_RELEASE = 36