Skip to content

Commit 3159c9d

Browse files
author
giraffedata
committed
Change to report format of tests which use Pnmpsnr
git-svn-id: https://svn.code.sf.net/p/netpbm/code/trunk@3086 9d0c8265-081b-0410-96cb-a4ca84ce46f8
1 parent 391e5b7 commit 3159c9d

7 files changed

+49
-20
lines changed

test/fiasco-roundtrip.ok

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3 1 1 1
1+
3 1000.00 1000.00 1000.00

test/fiasco-roundtrip.test

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
# TODO: As in jpeg-rountrip.test the threshold has been determined
88
# without much thought.
99

10-
# Should print 3 1 1 1
10+
# Should print 3 1000.00 1000.00 1000.00
1111

1212
tmpdir=${tmpdir:-/tmp}
1313
padded_ppm=${tmpdir}/padded.ppm
1414

1515
pnmpad --black --bottom 1 --left 1 testimg.ppm > ${padded_ppm} &&
1616
pnmtofiasco --progress-meter 0 ${padded_ppm} | fiascotopnm | \
1717
pnmpsnr -machine - ${padded_ppm} | \
18-
awk '{printf("%3d %1d %1d %1d",NF,$1>14.0,$2>21.0,$3>$29.0)}'
18+
awk '{printf("%3d %.2f %.2f %.2f", NF,
19+
$1>14.0 ? 1000.00 : $1,
20+
$2>21.0 ? 1000.00 : $2,
21+
$3>29.0 ? 1000.00 : $3) }'
1922

2023
rm ${padded_ppm}

test/jpeg-roundtrip.ok

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
3 1 1 1
2-
3 1 1 1
3-
3 1 1 1
1+
3 1000.00 1000.00 1000.00
2+
3 1000.00 1000.00 1000.00
3+
3 1000.00 1000.00 1000.00

test/jpeg-roundtrip.test

+14-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,23 @@
1010

1111
pnmtojpeg testimg.ppm | jpegtopnm | \
1212
pnmpsnr -machine - testimg.ppm |\
13-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>55.0,$2>57.0,$3>48.0)}'
13+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
14+
$1>55.0 ? 1000.00 : $1,
15+
$2>57.0 ? 1000.00 : $2,
16+
$3>48.0 ? 1000.00 : $3) }'
17+
1418

1519
pnmtojpeg testimg.ppm -opt | jpegtopnm | \
1620
pnmpsnr -machine - testimg.ppm |\
17-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>55.0,$2>57.0,$3>48.0)}'
21+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
22+
$1>55.0 ? 1000.00 : $1,
23+
$2>57.0 ? 1000.00 : $2,
24+
$3>48.0 ? 1000.00 : $3) }'
25+
1826

1927
pnmtojpeg testimg.ppm -progressive | jpegtopnm | \
2028
pnmpsnr -machine - testimg.ppm |\
21-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>55.0,$2>57.0,$3>48.0)}'
29+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
30+
$1>55.0 ? 1000.00 : $1,
31+
$2>57.0 ? 1000.00 : $2,
32+
$3>48.0 ? 1000.00 : $3) }'

test/jpeg2k-roundtrip.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/bash
22
# This script tests: pamtojpeg2k jpeg2ktopam
3-
# Also requires: pnmpsnr
3+
# Also requires:
44

55
# Should produce 1926073387 101484
66

test/tiffcmyk-roundtrip.ok

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
3 1 1 1
2-
3 1 1 1
3-
3 1 1 1
4-
3 1 1 1
5-
3 1 1 1
1+
3 1000.00 1000.00 1000.00
2+
3 1000.00 1000.00 1000.00
3+
3 1000.00 1000.00 1000.00
4+
3 1000.00 1000.00 1000.00
5+
3 1000.00 1000.00 1000.00

test/tiffcmyk-roundtrip.test

+20-5
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,46 @@ output_tiff=${tmpdir}/output.tiff
1616
pnmtotiffcmyk testimg.ppm > ${output_tiff} && \
1717
tifftopnm -headerdump -byrow ${output_tiff} | \
1818
pnmpsnr -machine - testimg.ppm | \
19-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
19+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
20+
$1>45.0 ? 1000.00 : $1,
21+
$2>59.5 ? 1000.00 : $2,
22+
$3>56.5 ? 1000.00 : $3) }'
2023

2124

2225
# Note that "-rowsperstrip=1" does not work
2326
pnmtotiffcmyk -rowsperstrip 1 -lsb2msb testimg.ppm > ${output_tiff} && \
2427
tifftopnm -respectfillorder -byrow ${output_tiff} | \
2528
pnmpsnr -machine - testimg.ppm | \
26-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
29+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
30+
$1>45.0 ? 1000.00 : $1,
31+
$2>59.5 ? 1000.00 : $2,
32+
$3>56.5 ? 1000.00 : $3) }'
2733

2834

2935
pnmtotiffcmyk -packbits testimg.ppm > ${output_tiff} && \
3036
tifftopnm -byrow ${output_tiff} | \
3137
pnmpsnr -machine - testimg.ppm | \
32-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
38+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
39+
$1>45.0 ? 1000.00 : $1,
40+
$2>59.5 ? 1000.00 : $2,
41+
$3>56.5 ? 1000.00 : $3) }'
3342

3443

3544
pnmtotiffcmyk -lzw testimg.ppm > ${output_tiff} && \
3645
tifftopnm -byrow ${output_tiff} | \
3746
pnmpsnr -machine - testimg.ppm | \
38-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
47+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
48+
$1>45.0 ? 1000.00 : $1,
49+
$2>59.5 ? 1000.00 : $2,
50+
$3>56.5 ? 1000.00 : $3) }'
3951

4052

4153
pnmtotiffcmyk -lzw -predictor 2 testimg.ppm > ${output_tiff} && \
4254
tifftopnm -respectfillorder -byrow ${output_tiff} | \
4355
pnmpsnr -machine - testimg.ppm | \
44-
awk '{printf("%3d %1d %1d %1d\n",NF,$1>45.0,$2>59.5,$3>56.5)}'
56+
awk '{printf("%3d %.2f %.2f %.2f\n", NF,
57+
$1>45.0 ? 1000.00 : $1,
58+
$2>59.5 ? 1000.00 : $2,
59+
$3>56.5 ? 1000.00 : $3) }'
4560

4661
rm ${output_tiff}

0 commit comments

Comments
 (0)