From 3f8fafb766a7042d5a10b9ae825f3bc9214024fd Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 15 May 2021 15:56:45 +0000 Subject: Release 10.86.22 git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4107 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/pamtogif.c | 4 ++-- converter/other/pamtopng.c | 15 +++++++++++++-- doc/HISTORY | 20 ++++++++++++++++++++ lib/util/nstring.c | 28 ++++++++++------------------ version.mk | 2 +- 5 files changed, 46 insertions(+), 23 deletions(-) diff --git a/converter/other/pamtogif.c b/converter/other/pamtogif.c index 8d432da1..185ad128 100644 --- a/converter/other/pamtogif.c +++ b/converter/other/pamtogif.c @@ -93,9 +93,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 a323844f..761d303d 100644 --- a/converter/other/pamtopng.c +++ b/converter/other/pamtopng.c @@ -287,7 +287,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", @@ -785,7 +795,8 @@ pngBitDepth(unsigned int const pnmBitDepth, unsigned int retval; 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) { retval = 8; diff --git a/doc/HISTORY b/doc/HISTORY index e2a860aa..c7c87ef9 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,26 @@ Netpbm. CHANGE HISTORY -------------- +21.05.15 BJH Release 10.86.22 + + 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 + . + + 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 . + + pamtopng: Fix: treats all tuple types that start with BLA as + BLACKANDWHITE. 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 . + 21.04.11 BJH Release 10.86.21 Build: fix failure of pammixmulti to compile for Mingw for lack diff --git a/lib/util/nstring.c b/lib/util/nstring.c index 7ef9fcfb..aff90ff3 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 + + 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 , 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 5025b910..0ad3d4bc 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 86 -NETPBM_POINT_RELEASE = 21 +NETPBM_POINT_RELEASE = 22 -- cgit 1.4.1