about summary refs log tree commit diff
path: root/test/tiff-flate-lzw-roundtrip.test
blob: 7e28a8995e7feb7f0cc5975487adbe9085a63026 (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
#! /bin/bash
# This script tests: pamtotiff tifftopnm
# Also requires: pnmquant

# 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}

test40_ppm=${tmpdir}/testimg40.ppm

# Make a test image with reduced colors which compresses better
# cksum is 764594701 101484
 
pnmquant 40 testimg.ppm | tee ${test40_ppm} | cksum
pamtotiff ${test40_ppm} | tifftopnm | cksum

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

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

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

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

rm ${test40_ppm}