about summary refs log tree commit diff
path: root/test/st4-roundtrip.test
blob: bd3da5f14a9395c5d76ce6de41d2fd6fd033bd99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash
# This script tests: pgmtost4 st4topgm
# Also requires: pamchannel pamtopnm pamcut

  alias st4topgm="${PBM_TESTPREFIX}st4topgm"
  alias pgmtost4="${PBM_TESTPREFIX}pgmtost4"
  shopt -s expand_aliases

# Input image of pgmtost4 must by 192x165

# Should produce 185194654 31695 which is the output of:
# pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | \
#   pamtopnm | pamcut -pad 0 0 192 165 | cksum

pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | \
  pamtopnm | pamcut -pad 0 0 192 165 | \
  pgmtost4 | st4topgm - | cksum