about summary refs log tree commit diff
path: root/test/pnmtojpeg-scans.test
blob: ea17c8c02b7892ccb7f35aa681b3aeb9990eb7a4 (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
#! /bin/bash
# This script tests: pnmtojpeg
# Also requires:

tmpdir=${tmpdir:-/tmp}
test_jpegscan=${tmpdir}/test.jpegscan
err_out=${tmpdir}/err.out

cat > ${test_jpegscan} << EOF
# This is a example of a scan script to be used by 'pnmtojpeg' with -scan .
# It should work with any color image.

#Interleaved DC scan for Y, Cb, Cr:
0, 1, 2: 0-0, 0, 0 ;

# AC scans:
0:  1- 2, 0, 0 ;
0:  3- 5, 0, 0 ;
1:  1-63, 0, 0 ;
2:  1-63, 0, 0 ;
0:  6- 9, 0, 0 ;
0: 10-63, 0, 0 ;
EOF

pnmtojpeg testimg.ppm -scans=${test_jpegscan} -verbose \
 > /dev/null 2> ${err_out} && echo "success" || echo "failure"

cat ${err_out}

rm ${err_out} ${test_jpegscan}

# TODO test invalid scan script