From 54191112065200f118588896c756ed48d99a515e Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 29 Aug 2020 04:29:01 +0000 Subject: Release 10.86.16 git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3933 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/anytopnm | 2 +- converter/ppm/hpcdtoppm/pcdovtoppm | 30 +++++++++++++++--------------- doc/HISTORY | 19 ++++++++++++++++++- editor/pnmmargin | 2 +- editor/pnmnorm.c | 2 +- other/pamdepth.c | 11 ++++++++++- version.mk | 2 +- 7 files changed, 47 insertions(+), 21 deletions(-) diff --git a/converter/other/anytopnm b/converter/other/anytopnm index 5409bccd..94838556 100755 --- a/converter/other/anytopnm +++ b/converter/other/anytopnm @@ -538,7 +538,7 @@ else fi tempdir=$(mktemp -d "${TMPDIR:-/tmp}/anytopnm.XXXXXXXX") || - ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) + { echo "Could not create temporary file. Exiting." 1>&2; exit 1; } trap 'rm -rf $tempdir' 0 # Take out all spaces diff --git a/converter/ppm/hpcdtoppm/pcdovtoppm b/converter/ppm/hpcdtoppm/pcdovtoppm index dbf6f53d..01a68313 100755 --- a/converter/ppm/hpcdtoppm/pcdovtoppm +++ b/converter/ppm/hpcdtoppm/pcdovtoppm @@ -114,12 +114,6 @@ fi tmpfile=`tempfile -p pi -m 600` -rowfiles=() -imagefiles=() -row=1 -col=1 -width=$size - # Convert the PCD overview file to many PPM images if [ -f $1 ] ; then hpcdtoppm -Overview $1 $tmpfile @@ -129,14 +123,20 @@ else usage fi +imagefiles= +rowfiles= +row=1 +col=1 +width=$size + for i in "$tmpfile"* do if [ -f $i ] ; then - description=`pnmfile $i` - if [ "${description[4]}" -le $size -a \ - "${description[6]}" -le $size ] ; then + thiswidth=$(pamfile -machine $i | cut -f 4 -d ' ') + thisheight=$(pamfile -machine $i | cut -f 5 -d ' ') + if [ "$thiswidth" -le $size -a "$thisheight" -le $size ] ; then cat $i > $tmpfile - else + else if [ "$colors" = "n" ] ; then pnmscale -quiet -xysize $size $size $i > $tmpfile else @@ -158,8 +158,8 @@ do fi rm -f $tmpfile - description=`pnmfile $imagefile` - width=$(( $width + ${description[4]} )) + thisWidth=$(pamfile -machine $i | cut -f 4 -d ' ') + width=$(( $width + $thisWidth )) imagefiles="$imagefiles $imagefile" if [ $col -ge $across -o $width -gt $maxwidth ] ; then @@ -172,7 +172,7 @@ do ppmquant -quiet $colors > $rowfile fi rm -f $imagefiles - imagefiles=() + imagefiles= rowfiles="$rowfiles $rowfile" col=1 row=$(( $row + 1 )) @@ -182,7 +182,7 @@ do fi done -if [ ${#imagefiles[*]} -gt 0 ] ; then +if [ -n $imagefiles ] ; then rowfile=pi.${row}.$$ rm -f $rowfile if [ "$colors" = "n" ] ; then @@ -195,7 +195,7 @@ if [ ${#imagefiles[*]} -gt 0 ] ; then rowfiles="$rowfiles $rowfile" fi -if [ ${#rowfiles[*]} = 1 ]; then +if [ $(echo $rowfiles|wc -w) -eq 1 ] ; then cat $rowfiles else if [ "$colors" = "n" ] ; then diff --git a/doc/HISTORY b/doc/HISTORY index ff371cda..512e3c86 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,7 +4,24 @@ Netpbm. CHANGE HISTORY -------------- -20.06.27 BJH Relese 10.86.15 +20.08.29 BJH Release 10.86.16 + + anytopnm, pnmmargin: Fail properly when unable to create + temporary file. Broken in Netpbm 10.75 (June 2016). + + pamdepth: fix bug: doesn't work on PAM with black and white + tuple type. + + pnmnorm: Fix bug: output too dark when -bpercent and -wpercent + indicate overlapping values. Broken since Netpbm 10.43 (June + 2008). + + pcdovtoppm: Fix some garbage from the conversion from csh to sh + in Netpbm 9.12 (March 2001) in conversion from csh arrays that + should have stopped it from working at all, despite reports from + users that they were using it. + +20.06.27 BJH Release 10.86.15 winicontoppm: Fix undefined behavior for various invalid input. Always broken. Winicontoppm was new in Netpbm 9.3 (June 2000). diff --git a/editor/pnmmargin b/editor/pnmmargin index 9dbe24b7..1b5370be 100755 --- a/editor/pnmmargin +++ b/editor/pnmmargin @@ -12,7 +12,7 @@ # implied warranty. tempdir=$(mktemp -d "${TMPDIR:-/tmp}/netpbm.XXXXXXXX") || - ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) + { echo "Could not create temporary file. Exiting." 1>&2; exit 1; } trap 'rm -rf $tempdir' 0 1 3 15 tmp1=$tempdir/pnmm1 diff --git a/editor/pnmnorm.c b/editor/pnmnorm.c index 2f9a6b20..3a181bf3 100644 --- a/editor/pnmnorm.c +++ b/editor/pnmnorm.c @@ -485,7 +485,7 @@ disOverlap(xelval const reqBvalue, } } else { /* Both ends are free; use the point halfway between them. */ - xelval const midPoint = (reqWvalue + reqBvalue + maxval/2)/2; + xelval const midPoint = (reqWvalue + reqBvalue)/2; *nonOlapBvalueP = MIN(midPoint, maxval-1); *nonOlapWvalueP = *nonOlapBvalueP + 1; } diff --git a/other/pamdepth.c b/other/pamdepth.c index 71dae9d8..96613d07 100644 --- a/other/pamdepth.c +++ b/other/pamdepth.c @@ -13,6 +13,7 @@ #include "pm_c_util.h" #include "mallocvar.h" +#include "nstring.h" #include "shhopt.h" #include "pam.h" @@ -157,11 +158,19 @@ main(int argc, const char * argv[]) { outpam.maxval = cmdline.newMaxval; if (PNM_FORMAT_TYPE(inpam.format) == PBM_TYPE) { - pm_message( "promoting from PBM to PGM" ); outpam.format = PGM_TYPE; } else outpam.format = inpam.format; + if (streq(inpam.tuple_type, PAM_PBM_TUPLETYPE)) { + pm_message("promoting from black and white to grayscale"); + strcpy(outpam.tuple_type, PAM_PGM_TUPLETYPE); + } else if (streq(inpam.tuple_type, PAM_PBM_ALPHA_TUPLETYPE)) { + pm_message("promoting from black and white to grayscale"); + strcpy(outpam.tuple_type, PAM_PGM_ALPHA_TUPLETYPE); + } else + strcpy(outpam.tuple_type, inpam.tuple_type); + pnm_writepaminit(&outpam); transformRaster(&inpam, &outpam); diff --git a/version.mk b/version.mk index 4bfe2d59..bb5e6ba1 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 86 -NETPBM_POINT_RELEASE = 15 +NETPBM_POINT_RELEASE = 16 -- cgit 1.4.1