From 2996947b0d9f2ac3616f0ede78e2bce6696ed57b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 25 Mar 2016 06:11:01 +0000 Subject: [PATCH] start fixing up test_thumbnail since --interpolator no longer does anything --- TODO | 5 ++++ test/test_thumbnail.sh | 63 +++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/TODO b/TODO index 49bceaba..e9875188 100644 --- a/TODO +++ b/TODO @@ -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? diff --git a/test/test_thumbnail.sh b/test/test_thumbnail.sh index 2231ae15..0b2af7d8 100755 --- a/test/test_thumbnail.sh +++ b/test/test_thumbnail.sh @@ -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 - +