about summary refs log tree commit diff
path: root/test/pi3-roundtrip.test
blob: cd4232ebf4aceab14b6593d551bed41ee41d478b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This script tests: pbmtopi3 pi3topbm
# Also requires: pbmmake pamcut

  alias pbmtopi3="${PBM_TESTPREFIX}pbmtopi3"
  alias pi3topbm="${PBM_TESTPREFIX}pi3topbm"
  alias pbmmake="${PBM_BINPREFIX}pbmmake"
  alias pamcut="${PBM_BINPREFIX}pamcut"
  shopt -s expand_aliases

# The pi3 image format specifies a fixed image size of 640x400.
# Pbmtopi3 rejects images that do not conform.

# Test
# Should print: 3139449799 32011
pbmmake -g 640 400 | pbmtopi3 | pi3topbm | cksum

# Test 2. 
# Should print: 2425386270 41
pamcut -pad 0 0 640 400 testgrid.pbm | \
  pbmtopi3 | pi3topbm | pamcut 0 0 14 16 | cksum