#!/bin/sh -e

export LC_ALL=C.UTF-8

if [ "$AUTOPKGTEST_TMP" = "" ] ; then
    AUTOPKGTEST_TMP=`mktemp -d /tmp/${debname}-test.XXXXXX`
    trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
fi

if [ -d "images" ] ; then
    echo "Using local images"
else
    echo "No images"
    # current upstrem has no images, so just exit with success
    exit 0
fi

cp -a images/* $AUTOPKGTEST_TMP
cd $AUTOPKGTEST_TMP

for testfile in *.png; do
    img2sixel $testfile -o ${testfile}.sixel
done

for testfile in *.jpg; do
    img2sixel $testfile -o ${testfile}.sixel
done

for testfile in *.six; do
    sixel2png -i $testfile -o ${testfile}.png
done
