about summary refs log tree commit diff
path: root/test/pamdice-roundtrip.test
blob: c5ccde6647d02bb206ece62c171e6a0646e7b471 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/bash
# This script tests: pamdice pamundice
# Also requires:


tmpdir=${tmpdir:-/tmp}
fname_stem=${tmpdir}/pamdice_part

echo test 1

pamdice testgrid.pbm -outstem=${fname_stem}
pamundice ${fname_stem}_%1d_%1a.pbm -down=1 -across=1 | cksum
rm ${fname_stem}_0_0.pbm

echo test 2

pamdice testgrid.pbm -outstem=${fname_stem} -width=3
pamundice ${fname_stem}_%1d_%1a.pbm -across=5 | cksum
rm ${fname_stem}_0_?.pbm

echo test 3

pamdice testgrid.pbm -outstem=${fname_stem} -height=4
pamundice ${fname_stem}_%1d_%1a.pbm -down=4 | cksum
rm ${fname_stem}_?_0.pbm

for flags in "" "-hoverlap=0" "-hoverlap=2" "-voverlap=0" "-voverlap=2"
  do
  echo test 4.${flags}
  pamdice testimg.ppm -outstem=${fname_stem} -width=50 -height=40
  pamundice ${fname_stem}_%1d_%1a.ppm -down=4 -across=5 | cksum
  rm ${fname_stem}_?_?.ppm
  done

echo test 5
pamdice testimg.ppm -outstem=${fname_stem} -width=20 -height=10
ls ${fname_stem}*.ppm | pamundice -listfile=- -across=12 -down=15 | cksum
rm ${fname_stem}_??_??.ppm