diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-09-26 16:03:01 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-09-26 16:03:01 +0000 |
commit | 67e1689f9d7e6b8dfffe393f2d318e3e374c7a36 (patch) | |
tree | 5943a3e98e1f12ed80d92e2cb8c5623d8af9fcd3 /test/pamslice-roundtrip.test | |
parent | fd6e24ededb4ee1e92e101ea50fe21d88630c17f (diff) | |
download | netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.gz netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.xz netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.zip |
Promote current development as Release 10.68
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2294 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pamslice-roundtrip.test')
-rwxr-xr-x | test/pamslice-roundtrip.test | 26 |
1 files changed, 16 insertions, 10 deletions
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} |