about summary refs log tree commit diff
path: root/test/palm-roundtrip2.test
blob: 4c94df8cf2c40208f68c2c72a9c3ce98a9dc477f (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
#! /bin/bash
# This script tests: pnmtopalm palmtopnm
# Also requires: pnmremap

tmpdir=${tmpdir:-/tmp}
test256color_ppm=${tmpdir}/test256color.ppm

if [ ${CHECK_TYPE} = install ]
  then mapfile=$(netpbm-config --datadir)/palmcolor8.map
  else mapfile=${PALMMAPDIR}/palmcolor8.map
fi

if [ ! -f ${mapfile} ]
  then
  echo "Cannot find palmcolor8.map.  Skipping." 1>&2
  exit 80;
fi


# Test. Should print 438301914 101484
# 5 times

pnmremap -mapfile=${mapfile} testimg.ppm | tee ${test256color_ppm} | cksum

for flags in "" \
             "-scanline_compression" \
             "-rle_compression" \
             "-packbits_compression" 
  do pnmtopalm -colormap $flags ${test256color_ppm} | palmtopnm | cksum; done

rm ${test256color_ppm}