diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-09-26 21:30:18 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-09-26 21:30:18 +0000 |
commit | 13ddd6e6ae24808acf0815de4e99868ffb094ed4 (patch) | |
tree | bd6e7d07bc33ce6edb22a913c44eb12f0ddbcc45 /converter | |
parent | 5d96d3c0c22088d20528fb0f0b126d175ec8a09f (diff) | |
download | netpbm-mirror-13ddd6e6ae24808acf0815de4e99868ffb094ed4.tar.gz netpbm-mirror-13ddd6e6ae24808acf0815de4e99868ffb094ed4.tar.xz netpbm-mirror-13ddd6e6ae24808acf0815de4e99868ffb094ed4.zip |
Release 10.73.33
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@3968 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r-- | converter/other/jpeg2000/libjasper/base/jas_stream.c | 2 | ||||
-rw-r--r-- | converter/other/jpeg2000/pamtojpeg2k.c | 12 | ||||
-rwxr-xr-x | converter/ppm/hpcdtoppm/pcdovtoppm | 30 |
3 files changed, 23 insertions, 21 deletions
diff --git a/converter/other/jpeg2000/libjasper/base/jas_stream.c b/converter/other/jpeg2000/libjasper/base/jas_stream.c index 16c948eb..24f835ed 100644 --- a/converter/other/jpeg2000/libjasper/base/jas_stream.c +++ b/converter/other/jpeg2000/libjasper/base/jas_stream.c @@ -414,9 +414,11 @@ jas_stream_t *jas_stream_tmpfile() if (rc == 0) { pm_setjmpbuf(&jmpbuf); *obj = pm_tmpfile_fd(); + pm_setjmpbuf(NULL); } else { /* pm_tmpfile_fd() threw an error */ jas_stream_destroy(stream); + pm_setjmpbuf(NULL); return 0; } } diff --git a/converter/other/jpeg2000/pamtojpeg2k.c b/converter/other/jpeg2000/pamtojpeg2k.c index 142e452f..90bd8955 100644 --- a/converter/other/jpeg2000/pamtojpeg2k.c +++ b/converter/other/jpeg2000/pamtojpeg2k.c @@ -195,15 +195,15 @@ parseCommandLine(int argc, char ** argv, if (!ilyrratesSpec) cmdlineP->ilyrrates = (char*) ""; if (progressionSpec) { - if (strcmp(progressionOpt, "lrcp") == 0) + if (streq(progressionOpt, "lrcp")) cmdlineP->progression = PROG_LRCP; - if (strcmp(progressionOpt, "rlcp") == 0) + else if (streq(progressionOpt, "rlcp")) cmdlineP->progression = PROG_RLCP; - if (strcmp(progressionOpt, "rpcl") == 0) + else if (streq(progressionOpt, "rpcl")) cmdlineP->progression = PROG_RPCL; - if (strcmp(progressionOpt, "pcrl") == 0) + else if (streq(progressionOpt, "pcrl")) cmdlineP->progression = PROG_PCRL; - if (strcmp(progressionOpt, "cprl") == 0) + else if (streq(progressionOpt, "cprl")) cmdlineP->progression = PROG_CPRL; else pm_error("Invalid value for -progression: '%s'. " @@ -431,7 +431,7 @@ writeJpc(jas_image_t * const jasperP, cmdline.imgareatlx, cmdline.imgareatly, cmdline.tilegrdtlx, - cmdline.tilegrdtlx, + cmdline.tilegrdtly, cmdline.tilewidth, cmdline.tileheight, cmdline.prcwidth, 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 |