From d2b19d2aac20aeef5b213ffb0163610cde5d040b Mon Sep 17 00:00:00 2001 From: giraffedata Date: Fri, 28 Jun 2019 21:02:17 +0000 Subject: Release 10.47.73 git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@3634 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/pnmtopng.c | 45 ++++++++++++++++++++++++++++----------------- doc/HISTORY | 11 +++++++++++ version.mk | 2 +- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/converter/other/pnmtopng.c b/converter/other/pnmtopng.c index 7d30b23b..76c7a3a4 100644 --- a/converter/other/pnmtopng.c +++ b/converter/other/pnmtopng.c @@ -152,6 +152,7 @@ struct cmdlineInfo { unsigned int modtimeSpec; time_t modtime; /* Meaningless if !modtimeSpec */ const char * palette; /* NULL if none */ + bool filterSetSpec; int filterSet; unsigned int force; unsigned int libversion; @@ -424,15 +425,17 @@ parseCommandLine(int argc, char ** argv, if (!paletteSpec) cmdlineP->palette = NULL; - if (filterSpec + nofilter + sub + up + avg + paeth > 1) - pm_error("You may specify at most one of " - "-nofilter, -sub, -up, -avg, -paeth, and -filter"); + if (filterSpec && (nofilter + sub + up + avg + paeth > 0)) + pm_error("You may mot specify -filter with " + "-nofilter, -sub, -up, -avg, or -paeth"); if (filterSpec) { if (filter < 0 || filter > 4) pm_error("-filter is obsolete. Use -nofilter, -sub, -up, -avg, " "and -paeth options instead."); - else + else { + cmdlineP->filterSetSpec = true; + switch (filter) { case 0: cmdlineP->filterSet = PNG_FILTER_NONE; break; case 1: cmdlineP->filterSet = PNG_FILTER_SUB; break; @@ -440,21 +443,26 @@ parseCommandLine(int argc, char ** argv, case 3: cmdlineP->filterSet = PNG_FILTER_AVG; break; case 4: cmdlineP->filterSet = PNG_FILTER_PAETH; break; } + } } else { - if (nofilter) - cmdlineP->filterSet = PNG_FILTER_NONE; - else if (sub) - cmdlineP->filterSet = PNG_FILTER_SUB; - else if (up) - cmdlineP->filterSet = PNG_FILTER_UP; - else if (avg) - cmdlineP->filterSet = PNG_FILTER_AVG; - else if (paeth) - cmdlineP->filterSet = PNG_FILTER_PAETH; - else - cmdlineP->filterSet = PNG_FILTER_NONE; + if (nofilter + sub + up + avg + paeth == 0) + cmdlineP->filterSetSpec = false; + else { + cmdlineP->filterSetSpec = true; + cmdlineP->filterSet = PNG_NO_FILTERS; /* initial value */ + if (nofilter) + cmdlineP->filterSet |= PNG_FILTER_NONE; + if (sub) + cmdlineP->filterSet |= PNG_FILTER_SUB; + if (up) + cmdlineP->filterSet |= PNG_FILTER_UP; + if (avg) + cmdlineP->filterSet |= PNG_FILTER_AVG; + if (paeth) + cmdlineP->filterSet |= PNG_FILTER_PAETH; + } } - + if (cmdlineP->sizeSpec) parseSizeOpt(size, &cmdlineP->size); @@ -2739,6 +2747,9 @@ convertpnm(struct cmdlineInfo const cmdline, doTimeChunk(cmdline, info_ptr); + if (cmdline.filterSetSpec) + png_set_filter(png_ptr, 0, cmdline.filterSet); + if (cmdline.filterSet != 0) png_set_filter(png_ptr, 0, cmdline.filterSet); diff --git a/doc/HISTORY b/doc/HISTORY index c91f6aca..8d44c6c6 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,17 @@ Netpbm. CHANGE HISTORY -------------- +19.06.28 BJH Release 10.47.73 + + pnmtopng: Fix bug: Defaults to no filters. Should be all + filters. Effect is larger PNG output. Broken after Netpbm + 10.26 (January 2005) but no later than Netpbm 10.35 (August + 2006). + + pnmtopng: Fix bug: Doesn't allow multiple filter options. + Broken after Netpbm 10.26 (January 2005) but no later than + Netpbm 10.35 (August 2006). + 19.03.30 BJH Release 10.47.72 pamstretch: Reject very large scale factors instead of producing diff --git a/version.mk b/version.mk index f8ccf3d2..40f9ce62 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 47 -NETPBM_POINT_RELEASE = 72 +NETPBM_POINT_RELEASE = 73 -- cgit 1.4.1