about summary refs log tree commit diff
path: root/test/pamenlarge-pamscale-point.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-02-03 04:07:38 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-02-03 04:07:38 +0000
commit8761a51d5f789792addbffb4013908ebadf9a442 (patch)
treec617e5386d93ee34ae300c3d6163be813c113fa6 /test/pamenlarge-pamscale-point.test
parentc46450499a9960fd380b341c3a439ee37aa7c88e (diff)
downloadnetpbm-mirror-8761a51d5f789792addbffb4013908ebadf9a442.tar.gz
netpbm-mirror-8761a51d5f789792addbffb4013908ebadf9a442.tar.xz
netpbm-mirror-8761a51d5f789792addbffb4013908ebadf9a442.zip
Add tests for pamenlarge, pamscale, pamstretch, pamfile
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3529 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pamenlarge-pamscale-point.test')
-rwxr-xr-xtest/pamenlarge-pamscale-point.test36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/pamenlarge-pamscale-point.test b/test/pamenlarge-pamscale-point.test
new file mode 100755
index 00000000..08b34bb7
--- /dev/null
+++ b/test/pamenlarge-pamscale-point.test
@@ -0,0 +1,36 @@
+#! /bin/bash
+# This script tests: pamenlarge pamscale
+# Also requires:
+
+tmpdir=${tmpdir:-/tmp}
+enlarge_ppm=${tmpdir}/enlarge.ppm
+
+# When scale factor is an integer and the pamscale filter is point (default)
+# pamenlarge and pamscale should produce identical output
+
+for option in 1 "2 -filter=point" "3 -linear" "4 -nomix" 5
+  do
+  scale=${option% *}
+  pamenlarge $scale testimg.ppm > ${enlarge_ppm}
+  pamscale   $option testimg.ppm | cmp -s - ${enlarge_ppm}  
+  echo $option ${PIPESTATUS[@]} ":" $?
+  rm  ${enlarge_ppm}  
+  done
+
+
+pamenlarge -xscale=7 -yscale=7 testimg.ppm > ${enlarge_ppm}
+pamscale   -xscale=7 -yscale=7 testimg.ppm | cmp -s - ${enlarge_ppm}  
+echo 7 ${PIPESTATUS[@]} ":" $?
+rm  ${enlarge_ppm}
+
+
+enlarge_pbm=${tmpdir}/enlarge.pbm
+
+for option in "6 -nomix" "15 -nomix -linear" "24 -nomix"
+  do
+  scale=${option%% *}
+  pamenlarge $scale testgrid.pbm > ${enlarge_pbm}
+  pamscale   $option testgrid.pbm | cmp -s - ${enlarge_pbm}  
+  echo $option ${PIPESTATUS[@]} ":" $?
+  rm  ${enlarge_pbm}
+  done