about summary refs log tree commit diff
path: root/test/tiff-flate-lzw-roundtrip.test
blob: 2b0a4536a6848d5ad02717bc40f0d527c1f51bdc (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
32
33
34
35
36
#! /bin/sh
# This script tests: pamtotiff tifftopnm
# Also requires: ppmpat

# Failure message
## If tiff-rountrip.test succeeds and this test fails, the likely
## cause is an old TIFF library which lacks certain compression
## features.

tmpdir=${tmpdir:-/tmp}
tartan_ppm=${tmpdir}/testimg40.ppm

# Make a test image with reduced colors which compresses better

echo "Test 1.  Should print 1079668603 10237 six times"

ppmpat -tartan --color=rgb:32/0d/b7,rgb:31/58/a3,rgb:e9/5e/d4 71 48 | \
  tee ${tartan_ppm} | cksum
pamtotiff ${tartan_ppm} | tifftopnm | cksum

# test flate compression
pamtotiff -flate ${tartan_ppm} | tifftopnm | cksum

# test adobeflate compression
pamtotiff -adobeflate ${tartan_ppm} | tifftopnm | cksum

# test LZW compression
pamtotiff -lzw ${tartan_ppm} | tifftopnm | cksum
pamtotiff -lzw -predictor=1 ${tartan_ppm} | tifftopnm | cksum

rm ${tartan_ppm}

echo "Test 2.  Should print 281226646 481"

# PBM image: test flate compression
pamtotiff -flate maze.pbm | tifftopnm | cksum