2014-11-19 16:01:28 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# set -x
|
|
|
|
|
|
|
|
. ./variables.sh
|
|
|
|
|
|
|
|
# make a large PNG, roughly the size of Chicago.png
|
2014-12-20 17:17:44 +01:00
|
|
|
printf "building huge test PNG image ... "
|
2014-12-20 18:12:12 +01:00
|
|
|
$vips replicate $image $tmp/huge.png 30 5
|
2014-11-19 16:01:28 +01:00
|
|
|
echo "ok"
|
|
|
|
|
|
|
|
huge=$tmp/huge.png
|
|
|
|
|
2014-12-20 17:17:44 +01:00
|
|
|
printf "testing vipsthumbnail ... "
|
2014-11-19 16:01:28 +01:00
|
|
|
rm -f $tmp/x.png
|
2014-12-20 18:12:12 +01:00
|
|
|
$vipsthumbnail $huge -o $tmp/x.png
|
|
|
|
if ! $vipsheader $tmp/x.png > /dev/null 2>&1 ; then
|
2014-11-19 16:01:28 +01:00
|
|
|
echo "vipsthumbnail failed in basic mode"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "ok"
|
|
|
|
|
|
|
|
if [ ! -d $tmp/readonly ] ; then
|
|
|
|
mkdir $tmp/readonly
|
|
|
|
chmod ugo-wx $tmp/readonly
|
|
|
|
fi
|
|
|
|
export TMPDIR=$tmp/readonly
|
|
|
|
|
2014-12-20 17:17:44 +01:00
|
|
|
printf "testing vipsthumbnail does not make temps ... "
|
2014-11-19 16:01:28 +01:00
|
|
|
rm -f $tmp/x.png
|
2014-12-20 18:12:12 +01:00
|
|
|
$vipsthumbnail $huge -o $tmp/x.png
|
|
|
|
if ! $vipsheader $tmp/x.png > /dev/null 2>&1 ; then
|
2014-11-19 16:01:28 +01:00
|
|
|
echo "vipsthumbnail made a temp"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "ok"
|
|
|
|
|
2017-02-27 11:22:36 +01:00
|
|
|
printf "testing shrink does not make temps ... "
|
2014-11-19 16:01:28 +01:00
|
|
|
rm -f $tmp/x.png
|
2017-02-27 11:22:36 +01:00
|
|
|
$vips shrink $huge $tmp/x.png 230 230
|
2014-12-20 18:12:12 +01:00
|
|
|
if ! $vipsheader $tmp/x.png > /dev/null 2>&1 ; then
|
2017-02-27 11:22:36 +01:00
|
|
|
echo "shrink made a temp"
|
2014-11-19 16:01:28 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "ok"
|