about summary refs log tree commit diff
path: root/test/pnmcrop-blank.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:29:32 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:29:32 +0000
commit23ce26f64c34e30951ad9ade2151552ed77e7357 (patch)
treed73b31a0c2f7c7be4a69f8a8e84e00dd39c432b5 /test/pnmcrop-blank.test
parent1b6e51a266008348ad93ed8b6ac9ec91b5024fea (diff)
downloadnetpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.gz
netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.xz
netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.zip
promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4558 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pnmcrop-blank.test')
-rwxr-xr-xtest/pnmcrop-blank.test55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/pnmcrop-blank.test b/test/pnmcrop-blank.test
new file mode 100755
index 00000000..bb26bdc0
--- /dev/null
+++ b/test/pnmcrop-blank.test
@@ -0,0 +1,55 @@
+#! /bin/sh
+# This script tests: pnmcrop
+# Also requires: pbmmake ppmmake
+
+tmpdir=${tmpdir:-/tmp}
+
+test_pbm=${tmpdir}/test.pbm
+test_ppm=${tmpdir}/test.ppm
+
+echo "Error messages should appear below the line." 1>&2
+echo "--------------------------------------------" 1>&2
+
+#Test 1
+echo Test 1
+
+( pbmmake -white 15 14; pbmmake -gray 15 14; pbmmake -black 15 14 ) > \
+  ${test_pbm}
+for type in    "-blank-image=pass" \
+               "-blank-image=minimize" \
+               "-blank-image=minimize -top" \
+               "-blank-image=minimize -bottom" \
+               "-blank-image=minimize -left" \
+               "-blank-image=minimize -right" \
+               "-blank-image=minimize -left -right" \
+               "-blank-image=maxcrop" \
+               "-blank-image=abort" ""
+  do
+  echo ${type}
+  pnmcrop -reportsize ${type} ${test_pbm} || echo "fail1"
+  pnmcrop -reportsize ${type} -white ${test_pbm} || echo "fail2"
+  pnmcrop -reportsize ${type} -black ${test_pbm} || echo "fail3"
+  done
+
+rm ${test_pbm}
+
+
+#Test 2
+
+ppmmake rgb:ff/ff/ff 100 99 > ${test_ppm}
+echo Test 2
+for type in    "-blank-image=maxcrop -top" \
+               "-blank-image=minimize" "-blank-image=maxcrop" \
+               "-blank-image=maxcrop -top" \
+               "-blank-image=maxcrop -bottom" \
+               "-blank-image=maxcrop -left" \
+               "-blank-image=maxcrop -right" \
+               "-blank-image=maxcrop -top -bottom -right" ""
+  do
+  echo ${type}
+  pnmcrop -reportsize ${type} ${test_ppm} || echo "fail4"
+  pnmcrop -reportsize ${type} -white ${test_ppm} || echo "fail5"
+  pnmcrop -reportsize ${type} -black ${test_ppm} || echo "fail6"
+  done
+
+rm ${test_ppm}
\ No newline at end of file