about summary refs log tree commit diff
path: root/test/jpeg-roundtrip.test
blob: 7cc0fc20ede4bc0dbabeb7a017a245019b3a6cbc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /bin/bash
# This script tests: pnmtojpeg jpegtopnm
# Also requires: pnmpsnr

# TODO: threshold has been determined without much thought.
# Observed pnmpsnr output: 56.20 58.26 49.38
# On another system:       54.73 49.41 44.52
# A small margin has been added to the above numbers.

# Should print "match" three times

pnmtojpeg testimg.ppm | jpegtopnm | \
  pnmpsnr -target1=54 -target2=49 -target3=44 - testimg.ppm

pnmtojpeg testimg.ppm -opt | jpegtopnm | \
  pnmpsnr -target1=54 -target2=49 -target3=44 - testimg.ppm

pnmtojpeg testimg.ppm -progressive | jpegtopnm | \
  pnmpsnr -target1=54 -target2=49 -target3=44 - testimg.ppm