diff options
37 files changed, 322 insertions, 219 deletions
diff --git a/test/all-in-place.test b/test/all-in-place.test index 87ddfad8..f93674eb 100755 --- a/test/all-in-place.test +++ b/test/all-in-place.test @@ -408,7 +408,10 @@ ${PBM_TESTPREFIX}pnmmargin --help 2> /dev/null # pnmtoplainpnm, ppmquantall, ppmrainbow, ppmshadow, ppmtomap # with trivial input. -cat > ${tmpdir}/test.pbm <<EOF +tmpdir=${tmpdir:-/tmp} +test_pbm=${tmpdir}/test.pbm + +cat > ${test_pbm} <<EOF P1 1 1 1 @@ -416,17 +419,17 @@ EOF for i in anytopnm pbmtox10bm pnmnoraw pnmtoplainpnm ppmtomap ppmshadow do - ${PBM_TESTPREFIX}$i ${tmpdir}/test.pbm > /dev/null 2> /dev/null; + ${PBM_TESTPREFIX}$i ${test_pbm} > /dev/null 2> /dev/null; testExitStatus $i 0 $? done for i in pnmquant pnmquantall ppmquant ppmquantall do - ${PBM_TESTPREFIX}$i 2 ${tmpdir}/test.pbm > /dev/null 2> /dev/null; + ${PBM_TESTPREFIX}$i 2 ${test_pbm} > /dev/null 2> /dev/null; testExitStatus $i 0 $? done -rm ${tmpdir}/test.pbm +rm ${test_pbm} ${PBM_TESTPREFIX}ppmrainbow rgb:00/00/00 rgb:ff/ff/ff \ -tmpdir=${tmpdir} -width=2 -height=2 > /dev/null diff --git a/test/facesaver-roundtrip.ok b/test/facesaver-roundtrip.ok index 32a4743b..430f3f5f 100644 --- a/test/facesaver-roundtrip.ok +++ b/test/facesaver-roundtrip.ok @@ -1 +1 @@ -2871603838 33838 +1571496937 33838 diff --git a/test/facesaver-roundtrip.test b/test/facesaver-roundtrip.test index 362edaf5..76de380d 100755 --- a/test/facesaver-roundtrip.test +++ b/test/facesaver-roundtrip.test @@ -1,13 +1,12 @@ #! /bin/bash # This script tests: pgmtofs fstopgm -# Also requires: ppmtopgm +# Also requires: pamchannel alias fstopgm="${PBM_TESTPREFIX}fstopgm" alias pgmtofs="${PBM_TESTPREFIX}pgmtofs" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases -# Should produce 2871603838 33838, cksum of testimg.pgm +# Should produce 1571496937 33838, cksum of testimg.red -ppmtopgm testimg.ppm | \ +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ pgmtofs | fstopgm | cksum diff --git a/test/gif-quant-roundtrip.test b/test/gif-quant-roundtrip.test index b5f69edd..7f99ca6e 100755 --- a/test/gif-quant-roundtrip.test +++ b/test/gif-quant-roundtrip.test @@ -11,10 +11,13 @@ colors=15 # any value between 2 - 256 works -pnmquant $colors testimg.ppm > ${tmpdir}/quant.ppm && -pamtogif ${tmpdir}/quant.ppm | giftopnm | \ - cmp -s - ${tmpdir}/quant.ppm > /dev/null +tmpdir=${tmpdir:-/tmp} +quant_ppm=${tmpdir}/quant.ppm + +pnmquant ${colors} testimg.ppm > ${quant_ppm} && +pamtogif ${quant_ppm} | giftopnm | \ + cmp -s - ${quant_ppm} > /dev/null echo $? -rm ${tmpdir}/quant.ppm +rm ${quant_ppm} diff --git a/test/gif-roundtrip.ok b/test/gif-roundtrip.ok index ece7593c..552bf90c 100644 --- a/test/gif-roundtrip.ok +++ b/test/gif-roundtrip.ok @@ -1,8 +1,8 @@ -2871603838 33838 -2871603838 33838 -2871603838 33838 -2871603838 33838 1926073387 101484 +1571496937 33838 +1571496937 33838 +1571496937 33838 +1571496937 33838 2425386270 41 2425386270 41 2425386270 41 diff --git a/test/gif-roundtrip.test b/test/gif-roundtrip.test index 574638ac..cb62bfb1 100755 --- a/test/gif-roundtrip.test +++ b/test/gif-roundtrip.test @@ -1,47 +1,59 @@ #! /bin/bash # This script tests: giftopnm pamtogif -# Also requires: ppmtopgm ppmtorgb3 rgb3toppm pbmmake +# Also requires: ppmtorgb3 rgb3toppm pbmmake alias giftopnm="${PBM_TESTPREFIX}giftopnm" alias pamtogif="${PBM_TESTPREFIX}pamtogif" alias pbmmake="${PBM_BINPREFIX}pbmmake" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" alias ppmtorgb3="${PBM_BINPREFIX}ppmtorgb3" alias rgb3toppm="${PBM_BINPREFIX}rgb3toppm" alias pnminvert="${PBM_BINPREFIX}pnminvert" shopt -s expand_aliases -# Test 1. Should produce 2871603838 33838 -# which is the result of ppmtopgm testimg.ppm | cksum -# four times - -ppmtopgm testimg.ppm | tee ${tmpdir}/testimg.pgm | pamtogif | giftopnm | cksum -pamtogif -interlace ${tmpdir}/testimg.pgm | giftopnm | cksum -pamtogif -sort ${tmpdir}/testimg.pgm | tee ${tmpdir}/testimg.gif | \ - giftopnm | cksum -echo "junk" >> ${tmpdir}/testimg.gif && \ - giftopnm -image=1 -quitearly ${tmpdir}/testimg.gif | cksum - -rm ${tmpdir}/testimg.pgm -rm ${tmpdir}/testimg.gif +tmpdir=${tmpdir:-/tmp} -# Test 2. Break up input image into three monochrome planes, +# Test 1. Break up input image into three monochrome planes, # maxval 255. Transform each plane to gif and back to pgm. # Reassemble the planes. Result should be identical to input. # Should print 1926073387 101484 +test_ppm=${tmpdir}/testimg.ppm + cp testimg.ppm ${tmpdir} && -ppmtorgb3 ${tmpdir}/testimg.ppm && -pamtogif ${tmpdir}/testimg.red | \ - giftopnm > ${tmpdir}/out.red && -pamtogif ${tmpdir}/testimg.grn | - giftopnm > ${tmpdir}/out.grn && -pamtogif ${tmpdir}/testimg.blu | \ - giftopnm | \ - rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn - | \ +ppmtorgb3 ${test_ppm} && + +test_red=${tmpdir}/testimg.red +test_grn=${tmpdir}/testimg.grn +test_blu=${tmpdir}/testimg.blu +out_red=${tmpdir}/out.red +out_grn=${tmpdir}/out.grn +out_blu=${tmpdir}/out.blu + +pamtogif ${test_red} | giftopnm > ${out_red} && +pamtogif ${test_grn} | giftopnm > ${out_grn} && +pamtogif ${test_blu} | giftopnm | \ + rgb3toppm ${out_red} ${out_grn} - | \ cksum -rm ${tmpdir}/testimg.{ppm,red,grn,blu} ${tmpdir}/out.{red,grn} +rm ${test_ppm} ${test_grn} ${test_blu} \ + ${out_red} ${out_grn} ${out_blu} + + +# Test 2. Should produce 1571496937 33838 +# which is the result of cksum testimg.red +# four times + +test_gif=${tmpdir}/testimg.gif + +pamtogif ${test_red} | giftopnm | cksum +pamtogif -interlace ${test_red} | giftopnm | cksum +pamtogif -sort ${test_red} | tee ${test_gif} | \ + giftopnm | cksum +echo "junk" >> ${test_gif} && \ + giftopnm -image=1 -quitearly ${test_gif} | cksum + +rm ${test_gif} ${test_red} + # Test 3. Should produce 2425386270 41 five times. diff --git a/test/jbig-roundtrip.ok b/test/jbig-roundtrip.ok index a951db19..b98a694b 100644 --- a/test/jbig-roundtrip.ok +++ b/test/jbig-roundtrip.ok @@ -1,2 +1,2 @@ 2425386270 41 -2871603838 33838 +1571496937 33838 diff --git a/test/jbig-roundtrip.test b/test/jbig-roundtrip.test index 766148c6..9ce23f51 100755 --- a/test/jbig-roundtrip.test +++ b/test/jbig-roundtrip.test @@ -1,14 +1,14 @@ #! /bin/bash # This script tests: pnmtojbig jbigtopnm -# Also requires: ppmtopgm +# Also requires: pamchannel alias pnmtojbig="${PBM_TESTPREFIX}pnmtojbig" alias jbigtopnm="${PBM_TESTPREFIX}jbigtopnm" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases # Test 1. Should print 2425386270 41 pnmtojbig testgrid.pbm | jbigtopnm | cksum -# Test 2. Should print 2871603838 33838 -ppmtopgm testimg.ppm | pnmtojbig | jbigtopnm | cksum \ No newline at end of file +# Test 2. Should print 1571496937 33838 +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ + pnmtojbig | jbigtopnm | cksum diff --git a/test/pamchannel.test b/test/pamchannel.test index e3da552c..9ac71f13 100755 --- a/test/pamchannel.test +++ b/test/pamchannel.test @@ -6,7 +6,6 @@ alias pamtopnm="${PBM_BINPREFIX}pamtopnm" shopt -s expand_aliases - # Extract planes one by one. # Convert output to pgm to make it identical to ppmtorgb3 output. @@ -26,8 +25,8 @@ pamchannel -infile testimg.ppm 0 | \ # Test 2. green channel # Should produce 394856971 33838 -pamchannel -infile testimg.ppm 1 | \ - pamtopnm --assume | cksum +pamchannel -infile testimg.ppm -tupletype="GRAYSCALE" 1 | \ + pamtopnm | cksum # Test 3. blue channel # Should produce 3164158573 33838 diff --git a/test/pamdice-roundtrip.test b/test/pamdice-roundtrip.test index 7319249a..7b863bca 100755 --- a/test/pamdice-roundtrip.test +++ b/test/pamdice-roundtrip.test @@ -6,8 +6,11 @@ alias pamundice="${PBM_TESTPREFIX}pamundice" shopt -s expand_aliases -pamdice testimg.ppm -outstem=${tmpdir}/a -width=50 -height=40 -pamundice ${tmpdir}/a_%1d_%1a.ppm -down=4 -across=5 | cksum +tmpdir=${tmpdir:-/tmp} +fname_stem=${tmpdir}/a -rm ${tmpdir}/a_?_?.ppm +pamdice testimg.ppm -outstem=${fname_stem} -width=50 -height=40 +pamundice ${fname_stem}_%1d_%1a.ppm -down=4 -across=5 | cksum + +rm ${fname_stem}_?_?.ppm diff --git a/test/pamditherbw.ok b/test/pamditherbw.ok index 0711fa38..e8186c24 100644 --- a/test/pamditherbw.ok +++ b/test/pamditherbw.ok @@ -1,4 +1,4 @@ -1421025574 33894 -164421928 33894 -486487763 33894 -3606822102 33894 +1316122660 33894 +3342429190 33894 +3325147568 33894 +4124728025 33894 diff --git a/test/pamditherbw.test b/test/pamditherbw.test index fef71efa..1ac1391c 100755 --- a/test/pamditherbw.test +++ b/test/pamditherbw.test @@ -1,35 +1,34 @@ #! /bin/bash # This script tests: pamditherbw -# Also requires: ppmtopgm +# Also requires: pamchannel alias pamditherbw="${PBM_TESTPREFIX}pamditherbw" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases -# Make test input -ppmtopgm testimg.ppm >${tmpdir}/testimg.pgm +tmpdir=${tmpdir:-/tmp} +test_red=${tmpdir}/testimg.red # Test 1. Simple threshold -pamditherbw -threshold -val=0.5 \ - ${tmpdir}/testimg.pgm | cksum +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ + tee ${test_red} | \ + pamditherbw -threshold -val=0.5 | cksum # Test 2. Floyd-Steinberg -#pamditherbw -floyd -val=0.5 ${tmpdir}/testimg.pgm | cksum +#pamditherbw -floyd -val=0.5 ${test_red} | cksum # Test 3. Atkinson -#pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum +#pamditherbw -atkinson -val=0.5 ${test_red} | cksum # Test 4. Hilbert -pamditherbw -hilbert ${tmpdir}/testimg.pgm | cksum +pamditherbw -hilbert ${test_red} | cksum # Test 5. Dither-8 -pamditherbw -dither8 ${tmpdir}/testimg.pgm | cksum +pamditherbw -dither8 ${test_red} | cksum # Test 6. Cluster4 -pamditherbw -cluster4 ${tmpdir}/testimg.pgm | cksum +pamditherbw -cluster4 ${test_red} | cksum # Test 7. Atkinson -#pamditherbw -atkinson -val=0.5 ${tmpdir}/testimg.pgm | cksum +#pamditherbw -atkinson -val=0.5 ${test_red} | cksum -# Remove test file -rm ${tmpdir}/testimg.pgm +rm ${test_red} diff --git a/test/pamenlarge.ok b/test/pamenlarge.ok index 40be5918..055262c9 100644 --- a/test/pamenlarge.ok +++ b/test/pamenlarge.ok @@ -1,4 +1,4 @@ 3424505894 913236 -4152147096 304422 +3763267672 304422 3342398172 297 237488670 3133413 diff --git a/test/pamenlarge.test b/test/pamenlarge.test index c1958d14..8f9e3c70 100755 --- a/test/pamenlarge.test +++ b/test/pamenlarge.test @@ -1,15 +1,15 @@ #! /bin/bash # This script tests: pamenlarge -# Also requires: ppmtopgm +# Also requires: pamchannel alias pamenlarge="${PBM_TESTPREFIX}pamenlarge" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases # Test 1. Should print 3424505894 913236 pamenlarge 3 testimg.ppm | cksum -# Test 2. Should print 4152147096 304422 -ppmtopgm testimg.ppm | pamenlarge 3 | cksum +# Test 2. Should print 3763267672 304422 +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ + pamenlarge 3 | cksum # Test 3. Should print 3342398172 297 pamenlarge 3 testgrid.pbm | cksum # Test 4. Should print 237488670 3133413 diff --git a/test/pamfile.ok b/test/pamfile.ok index 6cdf0433..57cc8cfd 100644 --- a/test/pamfile.ok +++ b/test/pamfile.ok @@ -1,3 +1,5 @@ testimg.ppm: PPM raw, 227 by 149 maxval 255 testgrid.pbm: PBM raw, 14 by 16 stdin: PGM raw, 227 by 149 maxval 255 +stdin: PAM, 227 by 149 by 1 maxval 255 + Tuple type: GRAYSCALE diff --git a/test/pamfile.test b/test/pamfile.test index 689578f1..1c1d3d23 100755 --- a/test/pamfile.test +++ b/test/pamfile.test @@ -1,11 +1,14 @@ #! /bin/bash # This script tests: pamfile -# Also requires: ppmtopgm +# Also requires: pamchannel alias pamfile="${PBM_TESTPREFIX}pamfile" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases pamfile testimg.ppm pamfile testgrid.pbm -ppmtopgm testimg.ppm | pamfile +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | pamfile +pamchannel -tupletype="GRAYSCALE" -infile=testimg.ppm 0 | pamfile + + + diff --git a/test/pamslice-roundtrip.test b/test/pamslice-roundtrip.test index edec0d26..f17765d1 100755 --- a/test/pamslice-roundtrip.test +++ b/test/pamslice-roundtrip.test @@ -30,14 +30,18 @@ # Add header and reconstruct ppm image. # Should print 914327477 4864 -pamcut 50 50 49 33 testimg.ppm > ${tmpdir}/test4933.ppm +tmpdir=${tmpdir:-/tmp} + +test4933_ppm=${tmpdir}/test4933.ppm + +pamcut 50 50 49 33 testimg.ppm > ${test4933_ppm} (echo "P3" echo "49 33" echo "255" seq 0 32 | while read i; do - pamslice -row=$i ${tmpdir}/test4933.ppm | awk '{print $2, $3, $4}'; + pamslice -row=$i ${test4933_ppm} | awk '{print $2, $3, $4}'; done ) | pnmtopnm | cksum # Same as above test 2, but take cols instead of rows. @@ -48,25 +52,27 @@ pamcut 50 50 49 33 testimg.ppm > ${tmpdir}/test4933.ppm echo "255" seq 0 48 | while read i; do - pamslice -col=$i ${tmpdir}/test4933.ppm | awk '{print $2, $3, $4}'; + pamslice -col=$i ${test4933_ppm} | awk '{print $2, $3, $4}'; done ) | pamflip -xy | cksum # Test 4. # Divide input image into two with pamdeinterlace and recombine. -pamdeinterlace -takeodd ${tmpdir}/test4933.ppm > ${tmpdir}/testodd.ppm -pamdeinterlace -takeeven ${tmpdir}/test4933.ppm > ${tmpdir}/testevn.ppm +testeven_ppm=${tmpdir}/testeven.ppm +testodd_ppm=${tmpdir}/testodd.ppm + +pamdeinterlace -takeodd ${test4933_ppm} > ${testodd_ppm} +pamdeinterlace -takeeven ${test4933_ppm} > ${testeven_ppm} (echo "P3" echo "49 33" echo "255" seq 0 15 | while read i; do - pamslice -row=$i ${tmpdir}/testevn.ppm | awk '{print $2, $3, $4}'; - pamslice -row=$i ${tmpdir}/testodd.ppm | awk '{print $2, $3, $4}'; + pamslice -row=$i ${testeven_ppm} | awk '{print $2, $3, $4}'; + pamslice -row=$i ${testodd_ppm} | awk '{print $2, $3, $4}'; done - pamslice -row=16 ${tmpdir}/testevn.ppm | awk '{print $2, $3, $4}'; + pamslice -row=16 ${testeven_ppm} | awk '{print $2, $3, $4}'; ) | pnmtopnm | tee /tmp/z | cksum -rm ${tmpdir}/test4933.ppm ${tmpdir}/testodd.ppm ${tmpdir}/testevn.ppm - +rm ${test4933_ppm} ${testodd_ppm} ${testeven_ppm} diff --git a/test/pbmclean.test b/test/pbmclean.test index 28242d30..5f324c5e 100755 --- a/test/pbmclean.test +++ b/test/pbmclean.test @@ -8,15 +8,17 @@ alias pnmmargin="${PBM_BINPREFIX}pnmmargin" shopt -s expand_aliases -pbmmake -g 3 3 | pnmmargin -black 2 \ - >${tmpdir}/test.pbm +tmpdir=${tmpdir:-/tmp} +test_pbm=${tmpdir}/test.pbm + +pbmmake -g 3 3 | pnmmargin -black 2 > ${test_pbm} for n in 1 2 3 4 5 6 7 8 do -pbmclean -min=$n -black -plain ${tmpdir}/test.pbm +pbmclean -min=$n -black -plain ${test_pbm} done -rm ${tmpdir}/test.pbm +rm ${test_pbm} # Should print 760076056 4210813 pbmpage 1 | pbmclean -black | cksum diff --git a/test/pgmtoppm.test b/test/pgmtoppm.test index cdd53623..f2d0fffb 100755 --- a/test/pgmtoppm.test +++ b/test/pgmtoppm.test @@ -8,17 +8,22 @@ alias pgmramp="${PBM_BINPREFIX}pgmramp" shopt -s expand_aliases -pgmramp -maxval=5 -lr 256 1 >${tmpdir}/test.pgm +tmpdir=${tmpdir:-/tmp} + +test_pgm=${tmpdir}/test.pgm +palette=${tmpdir}/palette + +pgmramp -maxval=5 -lr 256 1 >${test_pgm} pamseq 3 5 -tupletype=RGB | pamtopnm \ - >${tmpdir}/palette + >${palette} # Test 1. -pgmtoppm green ${tmpdir}/test.pgm | cksum +pgmtoppm green ${test_pgm} | cksum -pgmtoppm yellow-blue ${tmpdir}/test.pgm | cksum +pgmtoppm yellow-blue ${test_pgm} | cksum -pgmtoppm -map=${tmpdir}/palette ${tmpdir}/test.pgm | cksum +pgmtoppm -map=${palette} ${test_pgm} | cksum -rm ${tmpdir}/test.pgm ${tmpdir}/palette +rm ${test_pgm} ${palette} diff --git a/test/pnminvert.ok b/test/pnminvert.ok index 081e53ee..6cf5f011 100644 --- a/test/pnminvert.ok +++ b/test/pnminvert.ok @@ -1,6 +1,6 @@ 1240379484 41 1416115901 101484 -2961441369 33838 +1174803406 33838 2595564405 14 2595564405 14 2595564405 14 diff --git a/test/pnminvert.test b/test/pnminvert.test index eb25d2a0..f779d574 100755 --- a/test/pnminvert.test +++ b/test/pnminvert.test @@ -1,25 +1,29 @@ #! /bin/bash # This script tests: pnminvert -# Also requires: pbmmake ppmtopgm +# Also requires: pbmmake alias pnminvert="${PBM_TESTPREFIX}pnminvert" alias pbmmake="${PBM_BINPREFIX}pbmmake" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases # Test 1. Should print 1240379484 41 pnminvert testgrid.pbm | cksum + # Test 2. Should print 1416115901 101484 pnminvert testimg.ppm | cksum -# Test 3. Should print 2961441369 33838 -# printed 4215652354 33838 with older ppmtopgm -ppmtopgm testimg.ppm | pnminvert | cksum + +# Test 3. Should print +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ + pnminvert | cksum + # Test 4. Should print 2595564405 14 pbmmake -w 7 7 | pnminvert | cksum + # Test 5. Should print 2595564405 14 pbmmake -b 7 7 | cksum + # Test 6. Should print 2595564405 14 -pbmmake -b 7 7 | pnminvert | \ - pnminvert | cksum +pbmmake -b 7 7 | pnminvert | pnminvert | cksum + # Test 7. Should print 2896726098 15 pbmmake -g 8 8 | pnminvert | cksum diff --git a/test/pnmpsnr.test b/test/pnmpsnr.test index da88d70d..db1f0079 100755 --- a/test/pnmpsnr.test +++ b/test/pnmpsnr.test @@ -6,10 +6,18 @@ alias pbmmake="${PBM_BINPREFIX}pbmmake" shopt -s expand_aliases -pbmmake -w 10 10 > ${tmpdir}/w.pbm -pbmmake -b 10 10 > ${tmpdir}/b.pbm -pnmpsnr ${tmpdir}/w.pbm ${tmpdir}/b.pbm 2>&1 | \ +tmpdir=${tmpdir:-/tmp} + + +w_pbm=${tmpdir}/w.pbm +b_pbm=${tmpdir}/b.pbm + +pbmmake -w 10 10 > ${w_pbm} +pbmmake -b 10 10 > ${b_pbm} + +pnmpsnr ${w_pbm} ${b_pbm} 2>&1 | \ awk '{print $(NF-1),$NF}' -pnmpsnr ${tmpdir}/w.pbm ${tmpdir}/w.pbm 2>&1 | \ +pnmpsnr ${w_pbm} ${w_pbm} 2>&1 | \ awk '{print $(NF-1),$NF}' -rm ${tmpdir}/b.pbm ${tmpdir}/w.pbm + +rm ${b_pbm} ${w_pbm} diff --git a/test/pnmremap1.test b/test/pnmremap1.test index 208be2fb..20bee75d 100755 --- a/test/pnmremap1.test +++ b/test/pnmremap1.test @@ -8,9 +8,12 @@ alias pamtopnm="${PBM_BINPREFIX}pamtopnm" shopt -s expand_aliases -pamseq 3 5 -tupletype=RGB | pamtopnm \ - > ${tmpdir}/palette -pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 +tmpdir=${tmpdir:-/tmp} +palette=${tmpdir}/palette +#palette255=${tmpdir}/palette255 + +pamseq 3 5 -tupletype=RGB | pamtopnm > ${palette} +#pamdepth 255 ${palette} > ${palette255} # Test 1. Floyd-Steinberg # This fails with older versions of Netpbm and x86-64. @@ -19,7 +22,10 @@ pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 # x86-32: 2667816854 101482 # x86-64: 3602410851 101482 -pnmremap -mapfile=${tmpdir}/palette -floyd -norandom \ +pnmremap -mapfile=${palette} -floyd -norandom \ testimg.ppm | cksum -rm ${tmpdir}/palette{,255} +#pnmremap -mapfile=${palette255} -floyd -norandom \ +# testimg.ppm | cksum + +rm ${palette} # ${palette255} diff --git a/test/pnmremap2.test b/test/pnmremap2.test index 3399dc39..e5444fda 100755 --- a/test/pnmremap2.test +++ b/test/pnmremap2.test @@ -8,20 +8,23 @@ alias pamtopnm="${PBM_BINPREFIX}pamtopnm" shopt -s expand_aliases -pamseq 3 5 -tupletype=RGB | pamtopnm \ - > ${tmpdir}/palette -pamdepth 255 ${tmpdir}/palette > ${tmpdir}/palette255 +tmpdir=${tmpdir:-/tmp} +palette=${tmpdir}/palette +palette255=${tmpdir}/palette255 + +pamseq 3 5 -tupletype=RGB | pamtopnm > ${palette} +pamdepth 255 ${palette} > ${palette255} # Test 2. Default (unmodified quantization) -pnmremap -mapfile=${tmpdir}/palette -nofloyd \ +pnmremap -mapfile=${palette} -nofloyd \ testimg.ppm | cksum # Test 3. Use first color in palette for missing colors -pnmremap -mapfile=${tmpdir}/palette255 -nofloyd \ +pnmremap -mapfile=${palette255} -nofloyd \ -firstisdefault testimg.ppm | cksum # Test 4. Use black for missing colors -pnmremap -mapfile=${tmpdir}/palette255 -nofloyd \ +pnmremap -mapfile=${palette255} -nofloyd \ -missingcolor=black testimg.ppm | cksum -rm ${tmpdir}/palette{,255} +rm ${palette} ${palette255} diff --git a/test/pnmtile.test b/test/pnmtile.test index f74bdce3..40d9cfc2 100755 --- a/test/pnmtile.test +++ b/test/pnmtile.test @@ -6,12 +6,20 @@ alias pnmcat="${PBM_BINPREFIX}pnmcat" shopt -s expand_aliases +# Test 1. Should print 4228632379 259 pnmtile 40 50 testgrid.pbm | cksum -pnmtile 454 298 testimg.ppm > ${tmpdir}/testimg4.ppm && -pnmcat -lr testimg.ppm testimg.ppm > ${tmpdir}/testimg2.ppm && -pnmcat -tb ${tmpdir}/testimg2.ppm ${tmpdir}/testimg2.ppm | \ -cmp -s - ${tmpdir}/testimg4.ppm +tmpdir=${tmpdir:-/tmp} + +# Test 2. Compare 2x2 tile images produced by pnmtile and pnmcat +# Should print 0 +testimg2_ppm=${tmpdir}/testimg2.ppm +testimg4_ppm=${tmpdir}/testimg4.ppm + +pnmtile 454 298 testimg.ppm > ${testimg4_ppm} && +pnmcat -lr testimg.ppm testimg.ppm > ${testimg2_ppm} && +pnmcat -tb ${testimg2_ppm} ${testimg2_ppm} | \ +cmp -s - ${testimg4_ppm} echo $? -rm ${tmpdir}/testimg{2,4}.ppm +rm ${testimg2_ppm} ${testimg4_ppm} diff --git a/test/ppmcie.test b/test/ppmcie.test index c4338195..973787ec 100755 --- a/test/ppmcie.test +++ b/test/ppmcie.test @@ -7,6 +7,12 @@ alias pamsumm="${PBM_BINPREFIX}pamsumm" shopt -s expand_aliases +# Failure message +## Ppmcie is sensitive to system factors. If this test fails, please +## run the program and visually examine the output. + +tmpdir=${tmpdir:-/tmp} + # Test 1. Should print 955840041 786447 # Without -nolabel -noaxes -nowpoint -noblack older versions of # Netpbm produce slightly different charts. @@ -14,8 +20,10 @@ # v. 10.35.86: 288356530 786447 # v. 10.59.2 : 2292601420 786447 +ppmcie_ppm=${tmpdir}/ppmcie.ppm + ppmcie -nolabel -noaxes -nowpoint -noblack \ - > ${tmpdir}/ppmcie.ppm + > ${ppmcie_ppm} # There is a slight difference in the output depending on whether ppmcie # is compiled with SSE features are turned on or off. @@ -31,7 +39,7 @@ ppmcie -nolabel -noaxes -nowpoint -noblack \ # x86 32 bit: 38.660173 # x86 64 bit: 38.681432 -pamsumm --mean --brief ${tmpdir}/ppmcie.ppm | \ +pamsumm --mean --brief ${ppmcie_ppm} | \ awk '{ if(38.65 < $1 && $1 <38.69) print "ok"; else print $1}' # Test 2. Measure image sharpness @@ -39,9 +47,9 @@ pamsumm --mean --brief ${tmpdir}/ppmcie.ppm | \ # x86 32 bit: 0.002476 # x86 64 bit: 0.002478 -pamsharpness ${tmpdir}/ppmcie.ppm 2>&1 | \ +pamsharpness ${ppmcie_ppm} 2>&1 | \ awk 'NF==3 && $1=="Sharpness" \ {if (0.002475 < $3 && $3 < 0.002479) print "ok"; else print $3} NF>0 && NF!=3 {print "error"}' -rm ${tmpdir}/ppmcie.ppm +rm ${ppmcie_ppm} diff --git a/test/ppmdim.test b/test/ppmdim.test index e528c3ce..cdd7df17 100755 --- a/test/ppmdim.test +++ b/test/ppmdim.test @@ -8,18 +8,23 @@ alias pnmarith="${PBM_BINPREFIX}pnmarith" shopt -s expand_aliases +tmpdir=${tmpdir:-/tmp} + # Compare ppmdim and pamfunc with various dim factors # Due to the difference in rounding methods, pamfunc produces slightly # brighter images, by about 0.5 per pixel. # If the mean difference is between 0 and 0.75 we consider the output # normal. This works for dim values up to 0.994 . +dim1_ppm=${tmpdir}/dim1.ppm +dim2_ppm=${tmpdir}/dim2.ppm for i in 0.125 0.25 0.5 0.75 0.1 0.0117 0.2 0.4 0.333 0.666 0.8 0.9 0.95 do - ppmdim $i testimg.ppm > ${tmpdir}/dim1.ppm - pamfunc -mult=$i testimg.ppm > ${tmpdir}/dim2.ppm - pnmarith -diff ${tmpdir}/dim1.ppm ${tmpdir}/dim2.ppm | \ + ppmdim $i testimg.ppm > ${dim1_ppm} + pamfunc -mult=$i testimg.ppm > ${dim2_ppm} + pnmarith -diff ${dim1_ppm} ${dim2_ppm} | \ pamsumm -mean -brief | \ awk '{print $1<0.75 ? "ok" : "fail"}' done -rm ${tmpdir}/dim[12].ppm + +rm ${dim1_ppm} ${dim2_ppm} diff --git a/test/ppmmix.test b/test/ppmmix.test index d24e589d..25e35f0e 100755 --- a/test/ppmmix.test +++ b/test/ppmmix.test @@ -13,14 +13,19 @@ alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases -# Print a pretty checkerboard pattern +tmpdir=${tmpdir:-/tmp} + +# Test 1. Print a pretty checkerboard pattern +a1_pgm=${tmpdir}/a1.pgm +a2_pgm=${tmpdir}/a2.pgm + pbmmake -g 8 8 | \ - pgmtopgm > ${tmpdir}/a1.pgm && + pgmtopgm > ${a1_pgm} && pbmmake -g 2 2 | pamenlarge 4 | \ - pgmtopgm > ${tmpdir}/a2.pgm && -ppmmix 0.75 ${tmpdir}/a1.pgm ${tmpdir}/a2.pgm -plain | \ + pgmtopgm > ${a2_pgm} && +ppmmix 0.75 ${a1_pgm} ${a2_pgm} -plain | \ ppmtopgm | pamdepth 3 -plain && -rm ${tmpdir}/a1.pgm ${tmpdir}/a2.pgm +rm ${a1_pgm} ${a2_pgm} # Mix image with itself. # Output should match input regardless of ratio. @@ -31,8 +36,10 @@ done # Mix image with its own inverse. # Output should be a monotone gray sheet. +a3_ppm=${tmpdir}/a3.ppm + pnminvert testimg.ppm | ppmmix .5 \ - testimg.ppm - | tee ${tmpdir}/a3.ppm | \ + testimg.ppm - | tee ${a3_ppm} | \ pamsumm -brief -max && - pamsumm -brief -min ${tmpdir}/a3.ppm && -rm ${tmpdir}/a3.ppm + pamsumm -brief -min ${a3_ppm} && +rm ${a3_ppm} diff --git a/test/ps-alt-roundtrip.test b/test/ps-alt-roundtrip.test index 8c4cfc2a..d61e55d9 100755 --- a/test/ps-alt-roundtrip.test +++ b/test/ps-alt-roundtrip.test @@ -19,38 +19,49 @@ # # pbmtopsg3 and pbmtolps produce output that require pstopnm for decoding. # -# If ps-roundtrip.test succeeds and this test fails, it is most likely -# a problem with one of the minor utilities, and vice versa. +# Failure message +## If ps-roundtrip.test succeeds and this test fails, it is most likely +## a problem with one of the alternate Postscipt utilities: +## pbmtoepsi, pbmtopsg3, pbmtolps or psidtopgm. +## If both tests fail it indicates a problem with pstopnm or gs. # pstopnm does not use libnetpbm functions for output. # Output is filtered through pnmtopnm. # Test 1. Should print: 2425386270 41 +testgrid1_ps=${tmpdir}/testgrid1.ps + pbmtopsg3 -dpi=72 testgrid.pbm \ - > ${tmpdir}/testgrid1.ps && \ + > ${testgrid1_ps} && \ pstopnm -xborder=0 -yborder=0 -llx=0 -lly=-16 -urx=14 \ - -dpi=72 -stdout -quiet -pbm ${tmpdir}/testgrid1.ps | \ + -dpi=72 -stdout -quiet -pbm ${testgrid1_ps} | \ pnmcrop | cksum +rm ${testgrid1_ps} + # Test 2. Should print: 2425386270 41 +testgrid2_ps=${tmpdir}/testgrid2.ps + pbmtolps -dpi 72 testgrid.pbm \ - > ${tmpdir}/testgrid2.ps && \ + > ${testgrid2_ps} && \ pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \ - -quiet ${tmpdir}/testgrid2.ps -pbm | \ + -quiet ${testgrid2_ps} -pbm | \ pnmcrop | cksum +rm ${testgrid2_ps} # Test 3. Should print: 2916080186 235 # Output is pgm maxval=1 with black and white inverted. # -pbmtoepsi testgrid.pbm > ${tmpdir}/testgrid.epsi && \ +testgrid_epsi=${tmpdir}/testgrid.epsi + +pbmtoepsi testgrid.pbm > ${testgrid_epsi} && \ xysizebps=`awk '/BeginPreview/ {print $2,$3,$4}' \ - ${tmpdir}/testgrid.epsi` && \ + ${testgrid_epsi}` && \ awk '/^%%BeginPreview:/ { p=1; next } /^%%EndImage/ { p=0; next } \ p==1 && /%[ \t0-9a-fA-F]+/ { print substr($0,2); next } \ p==1 {print "!"$0}' \ - ${tmpdir}/testgrid.epsi | psidtopgm $xysizebps | cksum - + ${testgrid_epsi} | psidtopgm $xysizebps | cksum -rm ${tmpdir}/testgrid[12].ps ${tmpdir}/testgrid.epsi +rm ${testgrid_epsi} diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test index 1877724d..4773d4a6 100755 --- a/test/ps-roundtrip.test +++ b/test/ps-roundtrip.test @@ -16,46 +16,53 @@ ## (1) zlib was not linked. ## (2) ghostscript is not available. +tmpdir=${tmpdir:-/tmp} + # pstopnm does not use libnetpbm functions for output. # Output is filtered through pnmtopnm. # Test 1. Should print: 1926073387 101484 five times # *NOTE* Fifth iteration fails if pnmtops was compiled without zlib # (flate compression) support. +test1_ps=${tmpdir}/testimg1.ps + for flag in "" "-ps" "-rle" "-ps -ascii" "-ps -flate" do - pnmtops -nocenter -equalpixels -dpi 72 -noturn \ - ${flag} testimg.ppm \ - > ${tmpdir}/testimg.ps + pnmtops -nocenter -equalpixels -dpi 72 -noturn ${flag} testimg.ppm \ + > ${test1_ps} && \ xysize1=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ - ${tmpdir}/testimg.ps` - pstopnm -portrait -xborder=0 -yborder=0 $xysize1 -stdout \ - -quiet ${tmpdir}/testimg.ps | \ - pnmtopnm | cksum + ${test1_ps}` && \ + pstopnm -portrait -xborder=0 -yborder=0 $xysize1 -stdout -quiet \ + ${test1_ps} | pnmtopnm | cksum done - +rm ${test1_ps} # Test 2. Should print: 2918318199 62 seven times # Test image designed to detect problems with run-length compression # -pbmmake -g 2 2 > ${tmpdir}/g.pbm + +g_pbm=${tmpdir}/g.pbm +t_pbm=${tmpdir}/t.pbm +grid_ps=${tmpdir}/testgrid.ps + +pbmmake -g 2 2 > ${g_pbm} pbmmake -g 8 4 | \ pnmshear 45 -noantialias -background=black | \ pnmpad -right 60 | \ - pnmcat -tb -jright - ${tmpdir}/g.pbm > ${tmpdir}/t.pbm && + pnmcat -tb -jright - ${g_pbm} > ${t_pbm} && for flag in "" "-rle" "-ps -rle -ascii" \ "-bitspersample=2 -rle" "-ps -bitspersample=4 -rle" \ "-bitspersample=8 -rle" "-ps -bitspersample=12 -rle -dict" do - pnmtops -nocenter -equalpixels -dpi 72 -noturn \ - ${flag} ${tmpdir}/t.pbm > ${tmpdir}/testgrid.ps && + pnmtops -nocenter -equalpixels -dpi 72 -noturn ${flag} ${t_pbm} \ + > ${grid_ps} && \ xysize2=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ - ${tmpdir}/testgrid.ps` + ${grid_ps}` && \ pstopnm -portrait -xborder=0 -yborder=0 $xysize2 -stdout \ - -quiet ${tmpdir}/testgrid.ps -pbm | \ - pnmtopnm | cksum + -quiet ${grid_ps} -pbm | pnmtopnm | cksum done +rm ${grid_ps} ${g_pbm} ${t_pbm} #Test 3. Should print: 1386192571 507420 three times # *NOTE* Second iteration fails if pnmtops was compiled without zlib @@ -69,19 +76,19 @@ for flag in "" "-rle" "-ps -rle -ascii" \ # (3) pstopnm: input must be an ordinary file. Input from stdin # (by pipe or input redirection: "< file" ) does not work. # + +test3_ps=${tmpdir}/testimg3.ps + for flag in "" "-ps" \ "-ps -bitspersample=12 -flate -rle -vmreclaim" do cat testimg.ppm testimg.ppm testimg.ppm testgrid.pbm testgrid.pbm | \ -pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage \ - ${flag} > ${tmpdir}/testimg5.ps +pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage ${flag} \ + > ${test3_ps} && xysize3=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5 ; exit}' \ - ${tmpdir}/testimg5.ps` -pstopnm -portrait -xborder=0 -yborder=0 $xysize3 \ - -stdout ${tmpdir}/testimg5.ps | \ + ${test3_ps}` && +pstopnm -portrait -xborder=0 -yborder=0 $xysize3 -stdout ${test3_ps} | \ pnmtopnm | cksum done - -rm ${tmpdir}/testgrid.ps ${tmpdir}/testimg.ps ${tmpdir}/testimg5.ps \ - ${tmpdir}/t.pbm +rm ${test3_ps} diff --git a/test/rgb3-roundtrip.test b/test/rgb3-roundtrip.test index 829feab4..091fe46b 100755 --- a/test/rgb3-roundtrip.test +++ b/test/rgb3-roundtrip.test @@ -13,29 +13,40 @@ # image from them and check whether the resulting output is # identical to the original input. +tmpdir=${tmpdir:-/tmp} + +# Test 1. PPM (color) input +testimg_ppm=${tmpdir}/testimg.ppm +testimg_red=${tmpdir}/testimg.red +testimg_grn=${tmpdir}/testimg.grn +testimg_blu=${tmpdir}/testimg.blu + cp testimg.ppm ${tmpdir} && -ppmtorgb3 ${tmpdir}/testimg.ppm && -rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn \ - ${tmpdir}/testimg.blu | cksum +ppmtorgb3 ${testimg_ppm} && +rgb3toppm ${testimg_red} ${testimg_grn} ${testimg_blu} | cksum -cat ${tmpdir}/testimg.red ${tmpdir}/testimg.grn ${tmpdir}/testimg.blu | \ - cksum +cat ${testimg_red} ${testimg_grn} ${testimg_blu} | cksum -rm ${tmpdir}/testimg.{ppm,red,grn,blu} +rm ${testimg_ppm} ${testimg_red} ${testimg_grn} ${testimg_blu} + +# Test 2. PBM (monochrome) input +testgrid_pbm=${tmpdir}/testgrid.pbm +testgrid_red=${tmpdir}/testgrid.red +testgrid_grn=${tmpdir}/testgrid.grn +testgrid_blu=${tmpdir}/testgrid.blu cp testgrid.pbm ${tmpdir} && -ppmtorgb3 ${tmpdir}/testgrid.pbm && -rgb3toppm ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn \ - ${tmpdir}/testgrid.blu | \ +ppmtorgb3 ${testgrid_pbm} && +rgb3toppm ${testgrid_red} ${testgrid_grn} ${testgrid_blu} | \ ppmtopgm | pgmtopbm -th -val=0.5 | cksum - +# Test 3. # With PGM or PBM input, the three monochrome planes should be # identical. Test for this. -cmp -s ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn ; echo $? -cmp -s ${tmpdir}/testgrid.grn ${tmpdir}/testgrid.blu ; echo $? -pgmtopgm < testgrid.pbm | cmp -s - ${tmpdir}/testgrid.red +cmp -s ${testgrid_red} ${testgrid_grn} ; echo $? +cmp -s ${testgrid_grn} ${testgrid_blu} ; echo $? +pgmtopgm < testgrid.pbm | cmp -s - ${testgrid_red} echo $? -rm ${tmpdir}/testgrid.{pbm,red,grn,blu} +rm ${testgrid_pbm} ${testgrid_red} ${testgrid_grn} ${testgrid_blu} diff --git a/test/targa-roundtrip.ok b/test/targa-roundtrip.ok index 2b4b6eb9..9a428195 100644 --- a/test/targa-roundtrip.ok +++ b/test/targa-roundtrip.ok @@ -1,3 +1,3 @@ 2425386270 41 -2871603838 33838 +1571496937 33838 1926073387 101484 diff --git a/test/targa-roundtrip.test b/test/targa-roundtrip.test index 4a99e0e0..66e666c6 100755 --- a/test/targa-roundtrip.test +++ b/test/targa-roundtrip.test @@ -1,11 +1,10 @@ #! /bin/bash # This script tests: pamtotga tgatoppm -# Also requires: ppmtopgm pgmtopbm +# Also requires: pgmtopbm alias pamtotga="${PBM_TESTPREFIX}pamtotga" alias tgatoppm="${PBM_TESTPREFIX}tgatoppm" alias pgmtopbm="${PBM_BINPREFIX}pgmtopbm" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases #Test 1: Should print 2425386270 41, cksum of testgrid.pbm @@ -14,13 +13,9 @@ pamtotga -mono testgrid.pbm | \ tgatoppm | ppmtopgm | \ pgmtopbm -threshold -val 0.5 | cksum -#Test 2: Should print 2871603838 33838, cksum of testimg.pgm - -ppmtopgm testimg.ppm > ${tmpdir}/testimg.pgm -pamtotga -cmap ${tmpdir}/testimg.pgm | \ - tgatoppm | ppmtopgm | cksum - -rm ${tmpdir}/testimg.pgm +#Test 2: Should produce 1571496937 33838, cksum of testimg.red +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | \ + pamtotga -cmap | tgatoppm | ppmtopgm | cksum #Test 3: Should print 1926073387 101484, cksum of testimg.ppm diff --git a/test/utahrle-roundtrip.ok b/test/utahrle-roundtrip.ok index 35fc434c..203001aa 100644 --- a/test/utahrle-roundtrip.ok +++ b/test/utahrle-roundtrip.ok @@ -1,2 +1,2 @@ -2871603838 33838 +1571496937 33838 1926073387 101484 diff --git a/test/utahrle-roundtrip.test b/test/utahrle-roundtrip.test index 83bc6c90..dd88265c 100755 --- a/test/utahrle-roundtrip.test +++ b/test/utahrle-roundtrip.test @@ -1,18 +1,14 @@ #! /bin/bash # This script tests: pnmtorle rletopnm -# Also requires: ppmtopgm +# Also requires: alias pnmtorle="${PBM_TESTPREFIX}pnmtorle" alias rletopnm="${PBM_TESTPREFIX}rletopnm" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases -#Test 1. Should print 2871603838 33838, cksum of testimg.pgm -ppmtopgm testimg.ppm > ${tmpdir}/testimg.pgm -pnmtorle ${tmpdir}/testimg.pgm | \ - rletopnm | cksum - -rm ${tmpdir}/testimg.pgm +#Test 1. Should produce 1571496937 33838, cksum of testimg.red +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ + pnmtorle | rletopnm | cksum #Test 2. Should print 1926073387 101484, cksum of testimg.ppm pnmtorle testimg.ppm | \ diff --git a/test/xwd-roundtrip.ok b/test/xwd-roundtrip.ok index 011ebd3a..25d3d871 100644 --- a/test/xwd-roundtrip.ok +++ b/test/xwd-roundtrip.ok @@ -1,3 +1,3 @@ -2871603838 33838 +1571496937 33838 1926073387 101484 2425386270 41 diff --git a/test/xwd-roundtrip.test b/test/xwd-roundtrip.test index b5614f01..4dbd3020 100755 --- a/test/xwd-roundtrip.test +++ b/test/xwd-roundtrip.test @@ -1,17 +1,15 @@ #! /bin/bash # This script tests: pnmtoxwd xwdtopnm -# Also requires: pamdepth ppmtopgm +# Also requires: pamdepth alias pnmtoxwd="${PBM_TESTPREFIX}pnmtoxwd" alias xwdtopnm="${PBM_TESTPREFIX}xwdtopnm" alias pamdepth="${PBM_BINPREFIX}pamdepth" - alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" shopt -s expand_aliases -# Test 1. Should produce 2871603838 33838 -# which is the output of ppmtopgm testimg.ppm | cksum -ppmtopgm testimg.ppm | pnmtoxwd | \ - xwdtopnm | pamdepth 255 | cksum +# Test 1. Should produce 1571496937 33838, cksum of testimg.red +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \ + pnmtoxwd | xwdtopnm | pamdepth 255 | cksum # Test 2. Should produce 1926073387 101484 pnmtoxwd --quiet testimg.ppm | \ |