| 1 |
#!/usr/bin/perl |
| 2 |
# |
| 3 |
# Test reading TIFF images |
| 4 |
# |
| 5 |
# Contributed by Bob Friesenhahn <[email protected]> |
| 6 |
# |
| 7 |
BEGIN { $| = 1; $test=1; print "1..16\n"; } |
| 8 |
END {print "not ok $test\n" unless $loaded;} |
| 9 |
|
| 10 |
use Image::Magick; |
| 11 |
$loaded=1; |
| 12 |
|
| 13 |
require 't/subroutines.pl'; |
| 14 |
|
| 15 |
chdir 't/tiff' || die 'Cd failed'; |
| 16 |
|
| 17 |
# |
| 18 |
# 1) Test Reading Monochrome |
| 19 |
# |
| 20 |
print("Monochrome ...\n"); |
| 21 |
testRead ( 'input_mono.tiff', |
| 22 |
'71e1a6be223e307b1dbf732860792b15adba662b7a7ef284daf7f982f874ccf1' ); |
| 23 |
|
| 24 |
# |
| 25 |
# 2) Test reading PseudoColor (16 color) |
| 26 |
# |
| 27 |
++$test; |
| 28 |
print("PseudoColor (16 color)...\n"); |
| 29 |
testRead( 'input_16.tiff', |
| 30 |
'0de2dcbf667c69ae6735d1a701b4038c1eeea25cc86981a496bb26fc82541835' ); |
| 31 |
|
| 32 |
# |
| 33 |
# 3) Test reading PseudoColor (16 color + matte channel) |
| 34 |
# |
| 35 |
++$test; |
| 36 |
print("PseudoColor (16 color + matte channel)...\n"); |
| 37 |
testRead( 'input_16_matte.tiff', |
| 38 |
'0de2dcbf667c69ae6735d1a701b4038c1eeea25cc86981a496bb26fc82541835' ); |
| 39 |
|
| 40 |
# |
| 41 |
# 4) Test reading PseudoColor (256 color) |
| 42 |
# |
| 43 |
++$test; |
| 44 |
print("PseudoColor (256 color) ...\n"); |
| 45 |
testRead( 'input_256.tiff', |
| 46 |
'b2644ac928730aa1d28e754aeb17b4731b57daea28c9fb89b1b50623e87215b5' ); |
| 47 |
|
| 48 |
# |
| 49 |
# 5) Test reading PseudoColor (256 color + matte channel) |
| 50 |
# |
| 51 |
++$test; |
| 52 |
print("PseudoColor (256 color + matte channel) ...\n"); |
| 53 |
testRead( 'input_256_matte.tiff', |
| 54 |
'c8e5089f89ed3b7d067222e187ccd95da0a586f3a7f669876188fe8bfa04e6d9' ); |
| 55 |
|
| 56 |
# |
| 57 |
# 6) Test reading PseudoColor using contiguous planar packing |
| 58 |
# |
| 59 |
++$test; |
| 60 |
print("PseudoColor (256 color) contiguous planes ...\n"); |
| 61 |
testRead( 'input_256_planar_contig.tiff', |
| 62 |
'b2644ac928730aa1d28e754aeb17b4731b57daea28c9fb89b1b50623e87215b5' ); |
| 63 |
|
| 64 |
# |
| 65 |
# 7) Test reading PseudoColor using separate planes |
| 66 |
# |
| 67 |
++$test; |
| 68 |
print("PseudoColor (256 color) separate planes ...\n"); |
| 69 |
testRead( 'input_256_planar_separate.tiff', |
| 70 |
'b2644ac928730aa1d28e754aeb17b4731b57daea28c9fb89b1b50623e87215b5' ); |
| 71 |
|
| 72 |
# |
| 73 |
# 8) Test Reading TrueColor (8-bit) |
| 74 |
# |
| 75 |
++$test; |
| 76 |
print("TrueColor (8-bit) image ...\n"); |
| 77 |
testRead( 'input_truecolor.tiff', |
| 78 |
'f72b63be472e5e730ee2635463c6643d11057d251709ffe1f2027f69b57449df' ); |
| 79 |
|
| 80 |
# |
| 81 |
# 9) Test Reading TrueColor (16-bit) |
| 82 |
# |
| 83 |
++$test; |
| 84 |
print("TrueColor (16-bit) image ...\n"); |
| 85 |
testRead( 'input_truecolor_16.tiff', |
| 86 |
'7de73152fd38276a12bd4e137854b9dd27ae89dcd597e8789442e4d44df31e61', |
| 87 |
'81def436d1dea0ee118164ff4f017c62ad7a5a37bf97a820244a4e2c86c338ab' ); |
| 88 |
|
| 89 |
# |
| 90 |
# 10) Test Reading 8-bit TrueColor Tiled (32x32 tiles) |
| 91 |
# |
| 92 |
++$test; |
| 93 |
print("TrueColor (8-bit) tiled image, 32x32 tiles ...\n"); |
| 94 |
testRead( 'input_truecolor_tiled32x32.tiff', |
| 95 |
'f72b63be472e5e730ee2635463c6643d11057d251709ffe1f2027f69b57449df' ); |
| 96 |
|
| 97 |
# |
| 98 |
# 11) Test Reading 8-bit TrueColor Tiled (8 rows per strip) |
| 99 |
# |
| 100 |
++$test; |
| 101 |
print("TrueColor (8-bit) stripped, image, 8 rows per strip ...\n"); |
| 102 |
testRead( 'input_truecolor_stripped.tiff', |
| 103 |
'f72b63be472e5e730ee2635463c6643d11057d251709ffe1f2027f69b57449df' ); |
| 104 |
|
| 105 |
# |
| 106 |
# 12) Test Reading Grayscale 4-bit |
| 107 |
# |
| 108 |
++$test; |
| 109 |
print("Grayscale (4-bit) ...\n"); |
| 110 |
testRead( 'input_gray_4bit.tiff', |
| 111 |
'e55c01b0d28b0a19431ba27203db7cb6ada189c9519d4466c44a764aad5e185a'); |
| 112 |
|
| 113 |
# |
| 114 |
# 13) Test Reading Grayscale 8-bit |
| 115 |
# |
| 116 |
++$test; |
| 117 |
print("Grayscale (8-bit) ...\n"); |
| 118 |
testRead( 'input_gray_8bit.tiff', |
| 119 |
'b51e862fcc24d439870da413c664dfefc36cea1260d807b3208d6f091566263c'); |
| 120 |
|
| 121 |
# |
| 122 |
# 14) Test Reading Grayscale 8-bit + matte |
| 123 |
# |
| 124 |
++$test; |
| 125 |
print("Grayscale (8-bit + matte) ...\n"); |
| 126 |
testRead( 'input_gray_8bit_matte.tiff', |
| 127 |
'6002e57537cd54733551f8c4269e8104f2b14f8fcc58a07eda61f5911eb11c80' ); |
| 128 |
|
| 129 |
# |
| 130 |
# 15) Test Reading Grayscale 12-bit |
| 131 |
# |
| 132 |
++$test; |
| 133 |
print("Grayscale (12-bit) ...\n"); |
| 134 |
testRead( 'input_gray_12bit.tiff', |
| 135 |
'f343adc420b5fc7353cddecf48e6836d8ab8a91a6c78e316e903aec2d3f7293a', |
| 136 |
'638d5287bb0e6b585525334332ac348ab54903ad0104b789f9335413a8c59276' ); |
| 137 |
|
| 138 |
# |
| 139 |
# 16) Test Reading Grayscale 16-bit |
| 140 |
# |
| 141 |
++$test; |
| 142 |
print("Grayscale (16-bit) ...\n"); |
| 143 |
testRead( 'input_gray_16bit.tiff', |
| 144 |
'5d7d94a836efc6be6dc6a84be6017b19a0a5486cc9311b86462cd5e75abb9398', |
| 145 |
'9acab3f8b02e461149decd6dbb99d4b91be81a129e5f4cafc229e2f393173819' ); |