• 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  '71e1a6be223e307b1dbf732860792b15adba662b7a7ef284daf7f982f874ccf1' );
23
24#
25# 2) Test reading PseudoColor (16 color)
26#
27++$test;
28print("PseudoColor (16 color)...\n");
29testRead( 'input_16.tiff',
30  '0de2dcbf667c69ae6735d1a701b4038c1eeea25cc86981a496bb26fc82541835' );
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  '0de2dcbf667c69ae6735d1a701b4038c1eeea25cc86981a496bb26fc82541835' );
39
40#
41# 4) Test reading PseudoColor (256 color)
42#
43++$test;
44print("PseudoColor (256 color) ...\n");
45testRead( 'input_256.tiff',
46  'b2644ac928730aa1d28e754aeb17b4731b57daea28c9fb89b1b50623e87215b5' );
47
48#
49# 5) Test reading PseudoColor (256 color + matte channel)
50#
51++$test;
52print("PseudoColor (256 color + matte channel) ...\n");
53testRead( 'input_256_matte.tiff',
54	'24fc9ae8a8c00a01ba44a4f902230ca1a5841e283a5ec35e81815c194a344954' );
55
56#
57# 6) Test reading PseudoColor using contiguous planar packing
58#
59++$test;
60print("PseudoColor (256 color) contiguous planes ...\n");
61testRead( 'input_256_planar_contig.tiff',
62  'b2644ac928730aa1d28e754aeb17b4731b57daea28c9fb89b1b50623e87215b5' );
63
64#
65# 7) Test reading PseudoColor using seperate planes
66#
67++$test;
68print("PseudoColor (256 color) seperate planes ...\n");
69testRead( 'input_256_planar_separate.tiff',
70  'b2644ac928730aa1d28e754aeb17b4731b57daea28c9fb89b1b50623e87215b5' );
71
72#
73# 8) Test Reading TrueColor (8-bit)
74#
75++$test;
76print("TrueColor (8-bit) image ...\n");
77testRead( 'input_truecolor.tiff',
78  'ab90f892242d254e4c50dee17a7c8981bc7d46c9534bbb838cf5653c287886c8' );
79
80#
81# 9) Test Reading TrueColor (16-bit)
82#
83++$test;
84print("TrueColor (16-bit) image ...\n");
85testRead( 'input_truecolor_16.tiff',
86  '562a32f51f620139402c1cc2336fb03f655da47dedf9fdbccfd4d23df55dd3b6' );
87
88#
89# 10) Test Reading 8-bit TrueColor Tiled (32x32 tiles)
90#
91++$test;
92print("TrueColor (8-bit) tiled image, 32x32 tiles ...\n");
93testRead( 'input_truecolor_tiled32x32.tiff',
94  'ab90f892242d254e4c50dee17a7c8981bc7d46c9534bbb838cf5653c287886c8' );
95
96#
97# 11) Test Reading 8-bit TrueColor Tiled (8 rows per strip)
98#
99++$test;
100print("TrueColor (8-bit) stripped, image, 8 rows per strip ...\n");
101testRead( 'input_truecolor_stripped.tiff',
102  'ab90f892242d254e4c50dee17a7c8981bc7d46c9534bbb838cf5653c287886c8' );
103
104#
105# 12) Test Reading Grayscale 4-bit
106#
107++$test;
108print("Grayscale (4-bit) ...\n");
109testRead( 'input_gray_4bit.tiff',
110  'e55c01b0d28b0a19431ba27203db7cb6ada189c9519d4466c44a764aad5e185a');
111
112#
113# 13) Test Reading Grayscale 8-bit
114#
115++$test;
116print("Grayscale (8-bit) ...\n");
117testRead( 'input_gray_8bit.tiff',
118  'cdeea215166c095ef42557d63da3d037d16f4e7884e94b7db21e18e241d84f86');
119
120#
121# 14) Test Reading Grayscale 8-bit + matte
122#
123++$test;
124print("Grayscale (8-bit + matte) ...\n");
125testRead( 'input_gray_8bit_matte.tiff',
126  'fd4bf0cae6a978c301452178ae645a08cbd115659296a3fcfd5e07421bbaeb19' );
127
128#
129# 15) Test Reading Grayscale 12-bit
130#
131++$test;
132print("Grayscale (12-bit) ...\n");
133testRead( 'input_gray_12bit.tiff',
134  '638d5287bb0e6b585525334332ac348ab54903ad0104b789f9335413a8c59276');
135
136#
137# 16) Test Reading Grayscale 16-bit
138#
139++$test;
140print("Grayscale (16-bit) ...\n");
141testRead( 'input_gray_16bit.tiff',
142  '0cde228a8b2385f005fce6e3f027195a140971d2db9d122e0530e9e1fa75ea81');
143