diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
commit | 11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32 (patch) | |
tree | 7c40f096dd973943ef563ec87b2a68d8205db4fb /test/ppmdim.test | |
parent | 89c6ec14eb7514630aea5abc4b90b51d1473d33a (diff) | |
download | netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.gz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.xz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.zip |
Promote Stable to Super_stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@3640 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmdim.test')
-rwxr-xr-x | test/ppmdim.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ppmdim.test b/test/ppmdim.test new file mode 100755 index 00000000..848e2e9f --- /dev/null +++ b/test/ppmdim.test @@ -0,0 +1,25 @@ +#! /bin/bash +# This script tests: ppmdim +# Also requires: pamfunc pamarith pamsumm + + +tmpdir=${tmpdir:-/tmp} + +# Compare ppmdim and pamfunc with various dim factors +# Due to the difference in rounding methods, pamfunc produces slightly +# brighter images, by about 0.5 per pixel. +# If the mean difference is between 0 and 0.75 we consider the output +# normal. This works for dim values up to 0.994 . +dim1_ppm=${tmpdir}/dim1.ppm +dim2_ppm=${tmpdir}/dim2.ppm + +for i in 0.125 0.25 0.5 0.75 0.1 0.0117 0.2 0.4 0.333 0.666 0.8 0.9 0.95 + do + ppmdim $i testimg.ppm > ${dim1_ppm} + pamfunc -mult=$i testimg.ppm > ${dim2_ppm} + pamarith -diff ${dim1_ppm} ${dim2_ppm} | \ + pamsumm -mean -brief | \ + awk '{print ($1<0.75) ? "ok" : "fail"}' + done + +rm ${dim1_ppm} ${dim2_ppm} |