diff options
Diffstat (limited to 'test/ps-roundtrip.test')
-rwxr-xr-x | test/ps-roundtrip.test | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test index 207646cc..5d7b7d65 100755 --- a/test/ps-roundtrip.test +++ b/test/ps-roundtrip.test @@ -1,6 +1,6 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtops pstopnm -# Also requires: pamtopnm gs pbmmake pnmshear pnmpad pnmcat +# Also requires: pamtopnm gs pbmmake pnmshear pnmpad pamcat # Failure message @@ -11,7 +11,7 @@ tmpdir=${tmpdir:-/tmp} # pstopnm does not use libnetpbm functions for output. # Output is filtered through pamtopnm. -# Test 1. Should print: 1926073387 101484 four times +echo "Test 1. Should print 1926073387 101484 four times" test1_ps=${tmpdir}/testimg1.ps for flag in "" "-ps" "-rle" "-ps -ascii" @@ -25,9 +25,9 @@ for flag in "" "-ps" "-rle" "-ps -ascii" done rm ${test1_ps} -# Test 2. Should print: 2918318199 62 seven times + +echo "Test 2. Should print 2918318199 62 seven times" # Test image designed to detect problems with run-length compression -# g_pbm=${tmpdir}/g.pbm t_pbm=${tmpdir}/t.pbm @@ -37,7 +37,7 @@ pbmmake -g 2 2 > ${g_pbm} pbmmake -g 8 4 | \ pnmshear 45 -noantialias -background=black | \ pnmpad -right 60 | \ - pnmcat -tb -jright - ${g_pbm} > ${t_pbm} && + pamcat -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" @@ -52,8 +52,8 @@ for flag in "" "-rle" "-ps -rle -ascii" \ rm ${grid_ps} ${g_pbm} ${t_pbm} -#Test 3. Should print: 1386192571 507420 three times -# +echo "Test 3. Should print 1831481505 608904 three times" + # Special care is needed when conducting round-trips with multiple-image # files as input. # (1) pnmtops: -setpage is mandatory @@ -61,16 +61,16 @@ rm ${grid_ps} ${g_pbm} ${t_pbm} # Subsequent BoundingBox values are ignored. # (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 -rle -vmreclaim" do -cat testimg.ppm testimg.ppm testimg.ppm testgrid.pbm testgrid.pbm | \ -pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage ${flag} \ - > ${test3_ps} && +cat testimg.ppm testimg.ppm testimg.ppm maze.pbm \ + testgrid.pbm testgrid.pbm | \ + pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage ${flag} \ + > ${test3_ps} && xysize3=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5 ; exit}' \ ${test3_ps}` && pstopnm -portrait -xborder=0 -yborder=0 $xysize3 -stdout ${test3_ps} | \ |