about summary refs log tree commit diff
path: root/test/pad-crop-roundtrip.test
blob: 31e02c99887e739e22a64fece279ff0693d74fe1 (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
#! /bin/sh
# This script tests: pnmcrop pnmmargin pnmpad
# Also requires:

# Test 1. Should produce 1926073387 101484, cksum of testimg.ppm

pnmmargin -white 10 testimg.ppm | \
  pnmcrop | cksum

# Test 2. Should produce 1926073387 101484

pnmpad -white -left 10 -top 10 testimg.ppm | \
  pnmpad -white -right 10 -bottom 10 | \
  pnmcrop -right -bottom | pnmcrop -left -top | cksum

# Test 3. Should produce 281226646 481, cksum of maze.pbm

pnmmargin -white 10 maze.pbm | \
  pnmcrop | cksum

# Test 4. Should produce 281226646 481

pnmpad -white -left 10 -top 10 maze.pbm | \
  pnmpad -white -right 10 -bottom 10 | \
  pnmcrop -left -right | pnmcrop -top -bottom | cksum