about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Test-Order1
-rw-r--r--test/lps-roundtrip.ok1
-rwxr-xr-xtest/lps-roundtrip.test22
-rw-r--r--test/ps-alt-roundtrip.ok1
-rwxr-xr-xtest/ps-alt-roundtrip.test21
5 files changed, 31 insertions, 15 deletions
diff --git a/test/Test-Order b/test/Test-Order
index e9ea1b55..ab193a54 100644
--- a/test/Test-Order
+++ b/test/Test-Order
@@ -191,5 +191,6 @@ xwd-roundtrip.test
 
 fiasco-roundtrip.test
 jpeg-roundtrip.test
+lps-roundtrip.test
 tiffcmyk-roundtrip.test
 yuv-roundtrip.test
diff --git a/test/lps-roundtrip.ok b/test/lps-roundtrip.ok
new file mode 100644
index 00000000..02b1d1a9
--- /dev/null
+++ b/test/lps-roundtrip.ok
@@ -0,0 +1 @@
+match
diff --git a/test/lps-roundtrip.test b/test/lps-roundtrip.test
new file mode 100755
index 00000000..f30062a8
--- /dev/null
+++ b/test/lps-roundtrip.test
@@ -0,0 +1,22 @@
+#! /bin/bash
+# This script tests: pbmtolps pstopnm
+# Also requires: gs pamdepth pamscale pnmcrop pnmpsnr
+
+# The ordinary round-trip does not work because of the way ghostscript
+# renders: a line is considered wider than a single pixel and all pixels
+# it touches are set to black if the output is PBM.  To work around this,
+# we tell pstopnm to output PGM at a high resolution (=large dpi value).
+
+
+test_pgm=${tmpdir}/testgrid.pgm
+
+pamdepth 255 testgrid.pbm > ${test_pgm}
+
+pbmtolps -dpi 72 testgrid.pbm | \
+    pstopnm -dpi $((72*12)) -stdout -pgm | \
+    pnmcrop -white | pamscale -xsize=14 -ysize=16 | \
+    pnmpsnr -target=30 - ${test_pgm}
+
+# ghostscript version 8.71: pnmpsnr lumina 33.14dB
+
+rm ${test_pgm}
diff --git a/test/ps-alt-roundtrip.ok b/test/ps-alt-roundtrip.ok
index 1cd73f75..2deba38d 100644
--- a/test/ps-alt-roundtrip.ok
+++ b/test/ps-alt-roundtrip.ok
@@ -1,3 +1,2 @@
 2425386270 41
-2425386270 41
 2916080186 235
diff --git a/test/ps-alt-roundtrip.test b/test/ps-alt-roundtrip.test
index d90c4ddb..af7f7222 100755
--- a/test/ps-alt-roundtrip.test
+++ b/test/ps-alt-roundtrip.test
@@ -1,5 +1,5 @@
 #! /bin/bash
-# This script tests: pbmtoepsi pbmtopsg3 pbmtolps psidtopgm pstopnm
+# This script tests: pbmtoepsi pbmtopsg3 psidtopgm pstopnm
 # Also requires: gs pnmcrop
 
 
@@ -10,12 +10,15 @@
 # We keep these tests separate from those for pnmtops and pstopnm
 # which are far more popular.
 #
-# pbmtopsg3 and pbmtolps produce output that require pstopnm for decoding.
+# pbmtopsg3 produces output that requires pstopnm for decoding.
+#
+# We used to test pbmtolps here, but moved it out when gs changed its
+# rendering formula.
 #
 # 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.
+## pbmtoepsi, pbmtopsg3, or psidtopgm.
 ## If both tests fail it indicates a problem with pstopnm or gs.
 
 # pstopnm does not use libnetpbm functions for output.
@@ -33,18 +36,8 @@ pstopnm -xborder=0 -yborder=0 -llx=0 -lly=-16 -urx=14 \
 rm ${testgrid1_ps}
 
 
-# Test 2. Should print: 2425386270 41
-testgrid2_ps=${tmpdir}/testgrid2.ps
-
-pbmtolps -dpi 72 testgrid.pbm \
-     > ${testgrid2_ps} && \
-pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \
-    -quiet ${testgrid2_ps} -pbm | \
-  pnmcrop | cksum
-
-rm ${testgrid2_ps}
 
-# Test 3. Should print: 2916080186 235
+# Test 2. Should print: 2916080186 235
 # Output is pgm maxval=1 with black and white inverted.
 #
 testgrid_epsi=${tmpdir}/testgrid.epsi