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>2023-06-28 17:21:21 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:21:21 +0000
commit0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0 (patch)
tree3e8db9f13fb33464324c6986e7d80540a42a86c7 /test/tiffcmyk-roundtrip.test
parent7dd37058c4c8e0f6ca272e329162a52f958e4951 (diff)
downloadnetpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.gz
netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.xz
netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.zip
promote Stable to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@4557 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/tiffcmyk-roundtrip.test')
-rwxr-xr-xtest/tiffcmyk-roundtrip.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/tiffcmyk-roundtrip.test b/test/tiffcmyk-roundtrip.test
new file mode 100755
index 00000000..133c81b7
--- /dev/null
+++ b/test/tiffcmyk-roundtrip.test
@@ -0,0 +1,42 @@
+#! /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 -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
+
+
+# Note that "-rowsperstrip=1" does not work
+pnmtotiffcmyk -rowsperstrip 1 -lsb2msb testimg.ppm > ${output_tiff} && \
+  tifftopnm -respectfillorder -byrow  ${output_tiff} | \
+  pnmpsnr -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
+
+
+pnmtotiffcmyk -packbits testimg.ppm > ${output_tiff} && \
+  tifftopnm -byrow ${output_tiff} | \
+  pnmpsnr -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
+
+
+pnmtotiffcmyk -lzw testimg.ppm > ${output_tiff} && \
+  tifftopnm -byrow ${output_tiff} | \
+  pnmpsnr -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
+
+
+pnmtotiffcmyk -lzw -predictor 2 testimg.ppm > ${output_tiff} && \
+  tifftopnm -respectfillorder -byrow ${output_tiff} | \
+  pnmpsnr -target1=45.0 -target2=59.5 -target=56.5 - testimg.ppm
+
+
+rm ${output_tiff}