|
2 | 2 | # This script tests: giftopnm pamtogif
|
3 | 3 | # Also requires: ppmtopgm ppmtorgb3 rgb3toppm pbmmake
|
4 | 4 |
|
| 5 | + alias giftopnm="${PBM_TESTPREFIX}giftopnm" |
| 6 | + alias pamtogif="${PBM_TESTPREFIX}pamtogif" |
| 7 | + alias pbmmake="${PBM_BINPREFIX}pbmmake" |
| 8 | + alias ppmtopgm="${PBM_BINPREFIX}ppmtopgm" |
| 9 | + alias ppmtorgb3="${PBM_BINPREFIX}ppmtorgb3" |
| 10 | + alias rgb3toppm="${PBM_BINPREFIX}rgb3toppm" |
| 11 | + shopt -s expand_aliases |
| 12 | + |
5 | 13 | # Test 1. Should produce 2871603838 33838
|
6 | 14 | # which is the result of ppmtopgm testimg.ppm | cksum
|
7 | 15 |
|
8 |
| -${PBM_BINPREFIX}ppmtopgm testimg.ppm | \ |
9 |
| - ${PBM_TESTPREFIX}pamtogif | ${PBM_TESTPREFIX}giftopnm | cksum |
| 16 | +ppmtopgm testimg.ppm | \ |
| 17 | + pamtogif | giftopnm | cksum |
10 | 18 |
|
11 | 19 | # Test 2. Break up input image into three monochrome planes,
|
12 | 20 | # maxval 255. Transform each plane to gif and back to pgm.
|
13 | 21 | # Reassemble the planes. Result should be identical to input.
|
14 | 22 | # Should print 1926073387 101484
|
15 | 23 |
|
16 | 24 | cp testimg.ppm ${tmpdir} &&
|
17 |
| -${PBM_BINPREFIX}ppmtorgb3 ${tmpdir}/testimg.ppm && |
18 |
| -${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.red | \ |
19 |
| - ${PBM_TESTPREFIX}giftopnm > ${tmpdir}/out.red && |
20 |
| -${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.grn | |
21 |
| - ${PBM_TESTPREFIX}giftopnm > ${tmpdir}/out.grn && |
22 |
| -${PBM_TESTPREFIX}pamtogif ${tmpdir}/testimg.blu | \ |
23 |
| - ${PBM_TESTPREFIX}giftopnm | \ |
24 |
| - ${PBM_BINPREFIX}rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn - | \ |
| 25 | +ppmtorgb3 ${tmpdir}/testimg.ppm && |
| 26 | +pamtogif ${tmpdir}/testimg.red | \ |
| 27 | + giftopnm > ${tmpdir}/out.red && |
| 28 | +pamtogif ${tmpdir}/testimg.grn | |
| 29 | + giftopnm > ${tmpdir}/out.grn && |
| 30 | +pamtogif ${tmpdir}/testimg.blu | \ |
| 31 | + giftopnm | \ |
| 32 | + rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn - | \ |
25 | 33 | cksum
|
26 | 34 |
|
27 | 35 | rm ${tmpdir}/testimg.{ppm,red,grn,blu} ${tmpdir}/out.{red,grn}
|
28 | 36 |
|
29 | 37 | # Test 3. Should produce 2425386270 41
|
30 |
| -${PBM_TESTPREFIX}pamtogif testgrid.pbm | ${PBM_TESTPREFIX}giftopnm | cksum |
| 38 | +pamtogif testgrid.pbm | giftopnm | cksum |
31 | 39 |
|
32 | 40 | # Test 4.
|
33 | 41 | # In this gif file the code length changes after the last image data.
|
34 | 42 | # Image data: 3 bits, end code 4 bits.
|
35 | 43 | # Should produce P1 4 1 0 1 0 1
|
36 | 44 |
|
37 |
| -${PBM_BINPREFIX}pbmmake -g 4 1 | \ |
38 |
| - ${PBM_TESTPREFIX}pamtogif | ${PBM_TESTPREFIX}giftopnm -plain | \ |
| 45 | +pbmmake -g 4 1 | \ |
| 46 | + pamtogif | giftopnm -plain | \ |
39 | 47 | tr '\n' ' '
|
0 commit comments