• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/perl
2#
3# Test reading TIFF images
4#
5# Contributed by Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
6#
7BEGIN { $| = 1; $test=1; print "1..16\n"; }
8END {print "not ok $test\n" unless $loaded;}
9
10use Image::Magick;
11$loaded=1;
12
13require 't/subroutines.pl';
14
15chdir 't/tiff' || die 'Cd failed';
16
17#
18# 1) Test Reading Monochrome
19#
20print("Monochrome ...\n");
21testRead ( 'input_mono.tiff',
22  'dedb5873a990158f0e5abdebda8c8dfb32de0be16b2b191fcb476b754e000a7b' );
23
24#
25# 2) Test reading PseudoColor (16 color)
26#
27++$test;
28print("PseudoColor (16 color)...\n");
29testRead( 'input_16.tiff',
30  '58a82998d620aba54b86ab8dca7cbfeb726f3e86842369d5a0292a8522e95dab' );
31
32#
33# 3) Test reading PseudoColor (16 color + matte channel)
34#
35++$test;
36print("PseudoColor (16 color + matte channel)...\n");
37testRead( 'input_16_matte.tiff',
38  '58a82998d620aba54b86ab8dca7cbfeb726f3e86842369d5a0292a8522e95dab' );
39
40#
41# 4) Test reading PseudoColor (256 color)
42#
43++$test;
44print("PseudoColor (256 color) ...\n");
45testRead( 'input_256.tiff',
46  'ec6408aba63b43dfc594b4bd766e43457754bb2382a02c170e3d085366e9a6f4',
47  '59c97ab49c16b8664f1362242548399ad9e902b96959db98540ec820484380b1' );
48
49#
50# 5) Test reading PseudoColor (256 color + matte channel)
51#
52++$test;
53print("PseudoColor (256 color + matte channel) ...\n");
54testRead( 'input_256_matte.tiff',
55        '824af58cdd8a8accffee3dab1ed9d28b34a8b183d3e5f5f13caeaab03bcadd13',
56	'64b8429356cf9ea2b717faaa28a85b0f7ca174ea1a72063c1d4b2270084e4881' );
57
58#
59# 6) Test reading PseudoColor using contiguous planar packing
60#
61++$test;
62print("PseudoColor (256 color) contiguous planes ...\n");
63testRead( 'input_256_planar_contig.tiff',
64  'ec6408aba63b43dfc594b4bd766e43457754bb2382a02c170e3d085366e9a6f4',
65  '59c97ab49c16b8664f1362242548399ad9e902b96959db98540ec820484380b1' );
66
67#
68# 7) Test reading PseudoColor using seperate planes
69#
70++$test;
71print("PseudoColor (256 color) seperate planes ...\n");
72testRead( 'input_256_planar_separate.tiff',
73  'ec6408aba63b43dfc594b4bd766e43457754bb2382a02c170e3d085366e9a6f4',
74  '59c97ab49c16b8664f1362242548399ad9e902b96959db98540ec820484380b1' );
75
76#
77# 8) Test Reading TrueColor (8-bit)
78#
79++$test;
80print("TrueColor (8-bit) image ...\n");
81testRead( 'input_truecolor.tiff',
82  '2c5f5bcc5168543b807bf50476e472cd38e8d1a7d2c68df91e25ae7cd001166a' );
83
84#
85# 9) Test Reading TrueColor (16-bit)
86#
87++$test;
88print("TrueColor (16-bit) image ...\n");
89testRead( 'input_truecolor_16.tiff',
90  '9897466dce6a47db3530821056c0a1c6e20f20d5bbfce837addfbede63bdecab',
91  '768d8c7d0a52108f1f8dc12fb10412f42bc18f07b0a537dd77c7774bec04a273' );
92
93#
94# 10) Test Reading 8-bit TrueColor Tiled (32x32 tiles)
95#
96++$test;
97print("TrueColor (8-bit) tiled image, 32x32 tiles ...\n");
98testRead( 'input_truecolor_tiled32x32.tiff',
99  '2c5f5bcc5168543b807bf50476e472cd38e8d1a7d2c68df91e25ae7cd001166a' );
100
101#
102# 11) Test Reading 8-bit TrueColor Tiled (8 rows per strip)
103#
104++$test;
105print("TrueColor (8-bit) stripped, image, 8 rows per strip ...\n");
106testRead( 'input_truecolor_stripped.tiff',
107  '2c5f5bcc5168543b807bf50476e472cd38e8d1a7d2c68df91e25ae7cd001166a' );
108
109#
110# 12) Test Reading Grayscale 4-bit
111#
112++$test;
113print("Grayscale (4-bit) ...\n");
114testRead( 'input_gray_4bit.tiff',
115  '3d58e49ad202f2b171214f7a0e8ebdc2ac2c7e45b68a2249502f9339ca7efc6e');
116
117#
118# 13) Test Reading Grayscale 8-bit
119#
120++$test;
121print("Grayscale (8-bit) ...\n");
122testRead( 'input_gray_8bit.tiff',
123  '76f4dd783661899ede132a87a7c68132462d0a60efe92906388c3aca1fb76130');
124
125#
126# 14) Test Reading Grayscale 8-bit + matte
127#
128++$test;
129print("Grayscale (8-bit + matte) ...\n");
130testRead( 'input_gray_8bit_matte.tiff',
131  '30206f5082b53a8f81d1b0e5dfec94b3513b15ee3fe87fb646a7fd5bf9c94c04' );
132
133#
134# 15) Test Reading Grayscale 12-bit
135#
136++$test;
137print("Grayscale (12-bit) ...\n");
138testRead( 'input_gray_12bit.tiff',
139  '8784d89a246384f42210e980cfccb4e6c98de9dade262984bf756e16232e6c83');
140
141#
142# 16) Test Reading Grayscale 16-bit
143#
144++$test;
145print("Grayscale (16-bit) ...\n");
146testRead( 'input_gray_16bit.tiff',
147  'f056659e30e514325b8843d88f7bfa7a59c8b0496134ad0e66ea46eeece068d6',
148  'c8428037f92e6ef6c9fca343f3b6206dd9404304b310d20782346db874292e1f',
149  'c8428037f92e6ef6c9fca343f3b6206dd9404304b310d20782346db874292e1f');
150