about summary refs log tree commit diff
path: root/test/pi3-roundtrip.test
blob: d795157d012689b722c8440eeed0e9a494faf232 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/sh
# This script tests: pbmtopi3 pi3topbm
# Also requires: pbmmake pamcut pamfile

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

echo "Test 1. Should print: 3139449799 32011 twice"
pbmmake -g 640 400 | cksum
pbmmake -g 640 400 | pbmtopi3 | pi3topbm | cksum

echo "Test 2. Should print: 281226646 481, cksum of maze.pbm"
size=$(pamfile -size maze.pbm | awk '{print "-width="$1,"-height="$2}')
pamcut -pad -left=0 -top=0 -width=640 -height=400 maze.pbm | \
  pbmtopi3 | pi3topbm | pamcut -left=0 -top=0 ${size} | cksum