about summary refs log tree commit diff
path: root/test/tiffcmyk-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-06-30 03:27:10 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-06-30 03:27:10 +0000
commit08d938dc6fc6b30e5da6733b52c97169c0d24f8a (patch)
tree92673cd6a5755fc209078cc6b6a42602defc0212 /test/tiffcmyk-roundtrip.test
parente21f4e95d897c93a4779bf78c71f1341d164a222 (diff)
downloadnetpbm-mirror-08d938dc6fc6b30e5da6733b52c97169c0d24f8a.tar.gz
netpbm-mirror-08d938dc6fc6b30e5da6733b52c97169c0d24f8a.tar.xz
netpbm-mirror-08d938dc6fc6b30e5da6733b52c97169c0d24f8a.zip
Copy Development as new Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3018 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/tiffcmyk-roundtrip.test')
-rwxr-xr-xtest/tiffcmyk-roundtrip.test46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/tiffcmyk-roundtrip.test b/test/tiffcmyk-roundtrip.test
new file mode 100755
index 00000000..e123d807
--- /dev/null
+++ b/test/tiffcmyk-roundtrip.test
@@ -0,0 +1,46 @@
+#! /bin/bash
+# This script tests: pnmtotiffcmyk tifftopnm
+# Also requires: pnmpsnr
+
+# Failure message
+## If this test fails, the cause may be a problem in the TIFF library.
+
+tmpdir=${tmpdir:-/tmp}
+tartan_ppm=${tmpdir}/tartan.ppm
+output_ppm=${tmpdir}/output.ppm
+output_tiff=${tmpdir}/output.tiff
+
+# Note that color images cannot be tested by the roundtrip method
+# because of approximations incurred by converting from RGB to CMYK
+
+pnmtotiffcmyk testimg.ppm > ${output_tiff} && \
+  tifftopnm -headerdump -byrow ${output_tiff} | \
+  pnmpsnr -machine - testimg.ppm | \
+  awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
+
+
+# Note that "-rowsperstrip=1" does not work
+pnmtotiffcmyk -rowsperstrip 1 -lsb2msb testimg.ppm > ${output_tiff} && \
+  tifftopnm -respectfillorder -byrow  ${output_tiff} | \
+  pnmpsnr -machine - testimg.ppm | \
+  awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
+
+
+pnmtotiffcmyk -packbits testimg.ppm > ${output_tiff} && \
+  tifftopnm -byrow ${output_tiff} | \
+  pnmpsnr -machine - testimg.ppm | \
+  awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
+
+
+pnmtotiffcmyk -lzw testimg.ppm > ${output_tiff} && \
+  tifftopnm -byrow ${output_tiff} | \
+    pnmpsnr -machine - testimg.ppm | \
+  awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
+
+
+pnmtotiffcmyk -lzw -predictor 2 testimg.ppm > ${output_tiff} && \
+  tifftopnm -respectfillorder -byrow ${output_tiff} | \
+  pnmpsnr -machine - testimg.ppm | \
+  awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
+
+rm ${output_tiff}
\ No newline at end of file