From a042a8d460372090196663ede5cc0a13ef994226 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Fri, 13 Feb 2009 21:26:03 +0000 Subject: [PATCH] added tiff2rgba tests --- test/Makefile.am | 6 +++-- test/common.sh | 1 + test/images/README.txt | 6 ++++- test/images/minisblack-2c-8b-alpha.tiff | Bin 0 -> 4068 bytes test/tiff2rgba.sh | 29 ++++++++++++++++++++++++ 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 test/images/minisblack-2c-8b-alpha.tiff create mode 100755 test/tiff2rgba.sh diff --git a/test/Makefile.am b/test/Makefile.am index 85fe2deb..a7a4738a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -56,18 +56,20 @@ TESTSCRIPTS = \ tiff2ps-PS3.sh \ tiff2ps-EPS1.sh \ tiff2pdf.sh \ - tiffcrop.sh + tiffcrop.sh \ + tiff2rgba.sh IMAGES = \ images/minisblack-1c-16b.tiff \ images/minisblack-1c-8b.tiff \ images/miniswhite-1c-1b.tiff \ + images/miniswhite-2c-8b-alpha.tiff \ images/palette-1c-1b.tiff \ images/palette-1c-4b.tiff \ images/palette-1c-8b.tiff \ images/README.txt \ images/rgb-3c-16b.tiff \ - images/rgb-3c-8b.tiff + images/rgb-3c-8b.tiff noinst_HEADERS = tifftest.h diff --git a/test/common.sh b/test/common.sh index da2e77c6..6ade187c 100644 --- a/test/common.sh +++ b/test/common.sh @@ -41,6 +41,7 @@ IMG_PALETTE_1C_4B=${IMAGES}/palette-1c-4b.tiff IMG_PALETTE_1C_8B=${IMAGES}/palette-1c-8b.tiff IMG_RGB_3C_16B=${IMAGES}/rgb-3c-16b.tiff IMG_RGB_3C_8B=${IMAGES}/rgb-3c-8b.tiff +IMG_MINISBLACK_2C_8B_ALPHA=${IMAGES}/minisblack-2c-8b-alpha.tiff # All uncompressed image files IMG_UNCOMPRESSED="${IMG_MINISBLACK_1C_16B} ${IMG_MINISBLACK_1C_8B} ${IMG_MINISWHITE_1C_1B} ${IMG_PALETTE_1C_1B} ${IMG_PALETTE_1C_4B} ${IMG_PALETTE_1C_4B} ${IMG_PALETTE_1C_8B} ${IMG_RGB_3C_8B}" diff --git a/test/images/README.txt b/test/images/README.txt index 95f8eb5a..886bbae5 100644 --- a/test/images/README.txt +++ b/test/images/README.txt @@ -1,4 +1,4 @@ -The test files in this directory have dimension 157x151. +The test files in this directory mostly have dimension 157x151. The naming convention is photometric-channels-bits.tiff @@ -12,4 +12,8 @@ palette-1c-8b.tiff rgb-3c-16b.tiff rgb-3c-8b.tiff +minisblack-2c-8b-alpha.tiff: grey+alpha + + + diff --git a/test/images/minisblack-2c-8b-alpha.tiff b/test/images/minisblack-2c-8b-alpha.tiff new file mode 100644 index 0000000000000000000000000000000000000000..5fe8f5835b119e7e41e1ac85867fba20169317bd GIT binary patch literal 4068 zcmb`Kd2Afj9mi*9ZO7P&?Krk$Cr-R}NMj)6at@M^1Cnqh2sepBYzNzG?|OH3XLe?G z_TJe!-<#RB9VacPTJZ-$LRI;Ls-mh&k!Y(HK>=|erO-mTL&8-c5XHOwy%$HNf1yhF z{C#&n`{vE>_kF)N@5UQ1XC@mMW)Z`9yo`ronBDN}`A*D2%))E6@a>&@z1m=ynz@*K zroqE9t?<7Y#6nLMzy{14&(eC^>yCFn~^ zK5@e5_woKfAQ)$uYXag}(AOUp6QU9pCEuPyeZE_{SU^lG%!YOAwr*Rue%po(zV#co zZQ8u8Z!2>sA&y4_oHEXQ$+UIfCJVfr(QR~MMj94#s%GfAVO3DYuEwsL*w_3i^A*$W z{m}?;@tkQ}lO=IP%Bz~L>852{mhBWBX=fwBn&zz@ks_gJS~qo!VxzKJDO5DZm^J5F z2(akp`2=gJ?;DFpg5i{ITgZs`<61#g3$sQoK(32JYij8=8@2|M(NHXJmnL0xVmv`9 zLpMy@aUBN-d#ec6v2e$PG7*TWR%xcBh9*+FRw!tOX4tsmRva%HU*Vy1Yq>TQ8};*9 z4NsQ}d?ahm>RwYf(X8Wjtx?}6FqW_VdM-8^kW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 --- /dev/null +++ b/test/tiff2rgba.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Test a few case of the RGBA interface. +# +. ${srcdir:-.}/common.sh + + +outfile=deleteme-$$.tif +operation=tiff2rgba + +for FILE in \ + minisblack-2c-8b-alpha.tiff \ + palette-1c-1b.tiff \ + palette-1c-8b.tiff \ + rgb-3c-8b.tiff \ + minisblack-1c-8b.tiff ; do + + ${TIFF2RGBA} images/$FILE tiff2rgba-$FILE + status=$? + + if test $status -eq 0 ; then + rm -f tiff2rgba-$FILE + else + echo "Test failed (${operation} returns ${status}). Please inspect these output files:" + echo " " tiff2rgba-$FILE + fi +done + +exit $status