about summary refs log tree commit diff
path: root/test/palm-roundtrip2.test
blob: f0c9b7c872f317e73a10eeeb8dba5d8201f19c3e (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/sh
# 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}