start fixing up test_thumbnail

since --interpolator no longer does anything
This commit is contained in:
John Cupitt 2016-03-25 06:11:01 +00:00
parent da43a4041f
commit 2996947b0d
2 changed files with 36 additions and 32 deletions

5
TODO
View File

@ -1,3 +1,8 @@
- test_thumbnail.sh is failing ... 1000->999 makes a 998 image
- move 16->8 conversion to a separate pass? with so many constants, can't we
get an error for some mask sizes?
- try SEQ_UNBUFFERED on jpg source, get out of order error?
- could load pdf thumbnails?

View File

@ -1,7 +1,6 @@
#!/bin/sh
# resize a 1000x1000 image to every size in [500,1000] with every interpolator
# and check for black lines
# resize a 1000x1000 image to every size in [100,1000], check for black
# see https://github.com/jcupitt/libvips/issues/131
@ -23,39 +22,39 @@ break_threshold() {
return $(echo "$diff > $threshold" | bc -l)
}
for interp in nearest bilinear bicubic lbb nohalo vsqbs; do
size=1000
while [ $size -gt 499 ]; do
printf "testing $interp, size to $size ... "
vipsthumbnail $tmp/t1.v -o $tmp/t2.v --size $size --interpolator $interp
if [ $(vipsheader -f width $tmp/t2.v) -ne $size ]; then
echo failed -- bad size
echo output width is $(vipsheader -f width $tmp/t2.v)
exit
fi
if [ $(vipsheader -f height $tmp/t2.v) -ne $size ]; then
echo failed -- bad size
exit
fi
vips project $tmp/t2.v $tmp/cols.v $tmp/rows.v
size=1000
while [ $size -gt 99 ]; do
printf "testing size to $size ... "
vipsthumbnail $tmp/t1.v -o $tmp/t2.v --size $size
if [ $(vipsheader -f width $tmp/t2.v) -ne $size ]; then
echo $tmp/t2.v failed -- bad size
echo output width is $(vipsheader -f width $tmp/t2.v)
exit
fi
if [ $(vipsheader -f height $tmp/t2.v) -ne $size ]; then
echo $tmp/t2.v failed -- bad size
echo output height is $(vipsheader -f width $tmp/t2.v)
exit
fi
min=$(vips min $tmp/cols.v)
if break_threshold $min 0; then
echo failed -- has a black column
exit
fi
min=$(vips min $tmp/rows.v)
if break_threshold $min 0; then
echo failed -- has a black row
exit
fi
vips project $tmp/t2.v $tmp/cols.v $tmp/rows.v
echo ok
min=$(vips min $tmp/cols.v)
if break_threshold $min 0; then
echo $tmp/t2.v failed -- has a black column
exit
fi
size=$(($size-1))
done
min=$(vips min $tmp/rows.v)
if break_threshold $min 0; then
echo $tmp/t2.v failed -- has a black row
exit
fi
echo ok
size=$(($size-1))
done