#!/bin/sh set -e pkg=jpeg-xl CUR_DIR=`pwd` export LC_ALL=C.UTF-8 if [ "${AUTOPKGTEST_TMP}" = "" ] ; then AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX) trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM fi cd "${AUTOPKGTEST_TMP}" echo "Running Tests" echo "Test - Compression Ratio" cjxl /usr/share/libjxl-testdata/jxl/flower/flower.png flower.jxl jxlinfo flower.jxl djxl flower.jxl flower.png fsize=$(du -sb flower.jxl | cut -f1) if [ $fsize -gt 451040 ]; then echo "Invalid compression size: $fsize"; fi echo "Test - Lossless Roundtrip" # Simply verify we can decompress it. The decompression does not always gives # the same exact output. See: https://github.com/libjxl/libjxl/issues/1811 djxl /usr/share/libjxl-testdata/jxl/splines.jxl splines2.ppm cjxl -d 0.0 /usr/share/libjxl-testdata/jxl/grayscale_patches.png grayscale_patches.jxl djxl grayscale_patches.jxl grayscale_patches.pgm echo "0982d900a5829bbcba4a02b49f9a3bd9 grayscale_patches.pgm" >> checksums cjxl /usr/share/libjxl-testdata/jxl/traffic_light.gif traffic_light.jxl djxl traffic_light.jxl traffic_light.ppm echo "c75218992ba79d5234ecbb8597920143 traffic_light.ppm" >> checksums cjxl /usr/share/libjxl-testdata/jxl/animation_patches.gif animation_patches.jxl djxl animation_patches.jxl animation_patches.ppm echo "2d08eaa57fa44b705bd2c9213cc23b5b animation_patches.ppm" >> checksums djxl /usr/share/libjxl-testdata/jxl/pq_gradient.jxl pq_gradient.pgm echo "d7ae3496cd5b0acae95280d84b9f78ff pq_gradient.pgm" >> checksums md5sum --check checksums echo "run-unit-test: OK"