blob: 9818832b492ad7c4e3ffbb33b88786da355a1310 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001#!/usr/bin/perl
2#
3# Test writing TIFF images
4#
5# Contributed by Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
6#
7BEGIN { $| = 1; $test=1; print "1..10\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 4-bit pseudocolor image
19#
20print("PseudoColor image (4 bits/sample) ...\n");
21testReadWrite( 'input_16.tiff',
22 'output_16.tiff',
23 q//,
cristy11165b72011-09-28 17:26:49 +000024 '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846');
cristy3ed852e2009-09-05 21:47:34 +000025
26#
27# 2) Test 8-bit pseudocolor image
28#
29++$test;
30print("PseudoColor image (8 bits/sample) ...\n");
31testReadWrite( 'input_256.tiff',
32 'output_256.tiff',
33 q//,
cristy11165b72011-09-28 17:26:49 +000034 '48113b47a70a1d8dc046327cb9c799ed265e5d76a5eb0495d142015c4bd44b23');
cristy3ed852e2009-09-05 21:47:34 +000035
36#
37# 3) Test 4-bit pseudocolor + matte channel image
38#
39++$test;
40print("PseudoColor image (4 bits/sample + matte channel) ...\n");
41testReadWrite( 'input_16_matte.tiff',
42 'output_16_matte.tiff',
43 q//,
cristy11165b72011-09-28 17:26:49 +000044 '4c8ba149f3b22a9d846e72e8317834871f5fb173799620d4d059e62f69576846' );
cristy3ed852e2009-09-05 21:47:34 +000045
46#
47# 4) Test 8-bit pseudocolor + matte channel image
48#
49++$test;
50print("PseudoColor image (8 bits/sample + matte channel) ...\n");
51testReadWrite( 'input_256_matte.tiff',
52 'output_256_matte.tiff',
53 q//,
cristy11165b72011-09-28 17:26:49 +000054 'f50dea7da00ff27cc5fd5bc66bf0146b68b207ea7df919f72c4ccb02cb40f759' );
cristy3ed852e2009-09-05 21:47:34 +000055
56#
57# 5) Test truecolor image
58#
59++$test;
60print("TrueColor image (8 bits/sample) ...\n");
61testReadWrite( 'input_truecolor.tiff',
62 'output_truecolor.tiff',
63 q/quality=>55/,
cristy11165b72011-09-28 17:26:49 +000064 '359291f6da6c9118bef6d75604be979b3267e4df0716e1bfc357f13cafd0acb8' );
cristy3ed852e2009-09-05 21:47:34 +000065
66#
67# 6) Test monochrome image
68#
69++$test;
70print("Gray image (1 bit per sample) ...\n");
71testReadWrite( 'input_mono.tiff',
72 'output_mono.tiff',
73 q//,
cristy11165b72011-09-28 17:26:49 +000074 '57fc672e7e231d3f92793d9b2073132def273f4be3115bcbed1c49a1c3131222' );
cristy3ed852e2009-09-05 21:47:34 +000075
76#
77# 7) Test gray 4 bit image
78#
79++$test;
80print("Gray image (4 bits per sample) ...\n");
81testReadWrite( 'input_gray_4bit.tiff',
82 'output_gray_4bit.tiff',
83 q//,
cristy11165b72011-09-28 17:26:49 +000084 'a3ae7f6908bb538751f59565dd17f28f83201620ca3ccc8a87a388b3d4c50232' );
cristy3ed852e2009-09-05 21:47:34 +000085
86#
87# 8) Test gray 8 bit image
88#
89++$test;
90print("Gray image (8 bits per sample) ...\n");
91testReadWrite( 'input_gray_8bit.tiff',
92 'output_gray_8bit.tiff',
93 q//,
cristy11165b72011-09-28 17:26:49 +000094 '63783c30b21fca4cc94bb6c02ae37df722224a466d997db39bb7ddece5e236a8' );
cristy3ed852e2009-09-05 21:47:34 +000095
96#
97# 9) Test gray 4 bit image (with matte channel)
98#
99++$test;
100print("Gray image (4 bits per sample + matte channel) ...\n");
101testReadWrite( 'input_gray_4bit_matte.tiff',
102 'output_gray_4bit_matte.tiff',
103 q//,
cristy11165b72011-09-28 17:26:49 +0000104 '44cb1a46bd5a147f446b18cea8b07cfdf31acdc856029f95d91193add5c11b85' );
cristy3ed852e2009-09-05 21:47:34 +0000105
106#
107# 10) Test gray 8 bit image (with matte channel)
108#
109++$test;
110print("Gray image (8 bits per sample + matte channel) ...\n");
111testReadWrite( 'input_gray_8bit_matte.tiff',
112 'output_gray_8bit_matte.tiff',
113 q//,
cristy11165b72011-09-28 17:26:49 +0000114 '44cb1a46bd5a147f446b18cea8b07cfdf31acdc856029f95d91193add5c11b85' );