| 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
| 4 | pkg=jpeg-xl |
| 5 | |
| 6 | CUR_DIR=`pwd` |
| 7 | |
| 8 | export LC_ALL=C.UTF-8 |
| 9 | if [ "${AUTOPKGTEST_TMP}" = "" ] ; then |
| 10 | AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX) |
| 11 | trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM |
| 12 | fi |
| 13 | |
| 14 | cd "${AUTOPKGTEST_TMP}" |
| 15 | |
| 16 | echo "Running Tests" |
| 17 | |
| 18 | echo "Test - Compression Ratio" |
| 19 | |
| 20 | cjxl /usr/share/libjxl-testdata/jxl/flower/flower.png flower.jxl |
| 21 | jxlinfo flower.jxl |
| 22 | djxl flower.jxl flower.png |
| 23 | fsize=$(du -sb flower.jxl | cut -f1) |
| 24 | |
| 25 | if [ $fsize -gt 451040 ]; then |
| 26 | echo "Invalid compression size: $fsize"; |
| 27 | fi |
| 28 | |
| 29 | echo "Test - Lossless Roundtrip" |
| 30 | |
| 31 | # Simply verify we can decompress it. The decompression does not always gives |
| 32 | # the same exact output. See: https://github.com/libjxl/libjxl/issues/1811 |
| 33 | djxl /usr/share/libjxl-testdata/jxl/splines.jxl splines2.ppm |
| 34 | |
| 35 | cjxl -d 0.0 /usr/share/libjxl-testdata/jxl/grayscale_patches.png grayscale_patches.jxl |
| 36 | djxl grayscale_patches.jxl grayscale_patches.pgm |
| 37 | |
| 38 | echo "0982d900a5829bbcba4a02b49f9a3bd9 grayscale_patches.pgm" >> checksums |
| 39 | |
| 40 | cjxl /usr/share/libjxl-testdata/jxl/traffic_light.gif traffic_light.jxl |
| 41 | djxl traffic_light.jxl traffic_light.ppm |
| 42 | |
| 43 | echo "c75218992ba79d5234ecbb8597920143 traffic_light.ppm" >> checksums |
| 44 | |
| 45 | cjxl /usr/share/libjxl-testdata/jxl/animation_patches.gif animation_patches.jxl |
| 46 | djxl animation_patches.jxl animation_patches.ppm |
| 47 | |
| 48 | echo "2d08eaa57fa44b705bd2c9213cc23b5b animation_patches.ppm" >> checksums |
| 49 | |
| 50 | djxl /usr/share/libjxl-testdata/jxl/pq_gradient.jxl pq_gradient.pgm |
| 51 | |
| 52 | echo "d7ae3496cd5b0acae95280d84b9f78ff pq_gradient.pgm" >> checksums |
| 53 | |
| 54 | md5sum --check checksums |
| 55 | |
| 56 | echo "run-unit-test: OK" |