blob: f8408969e6e21af1f4de68c508a75c58c7807480 [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//,
cristyd2cb5a92011-12-31 20:10:15 +000024 '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4');
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//,
cristy18139f02012-03-11 17:51:02 +000034 'ec6408aba63b43dfc594b4bd766e43457754bb2382a02c170e3d085366e9a6f4',
cristyd2cb5a92011-12-31 20:10:15 +000035 '1280e7ed7094aaae47c0be1cb0b6d33660e59483a5500f5f40e34940346f7847');
cristy3ed852e2009-09-05 21:47:34 +000036
37#
38# 3) Test 4-bit pseudocolor + matte channel image
39#
40++$test;
41print("PseudoColor image (4 bits/sample + matte channel) ...\n");
42testReadWrite( 'input_16_matte.tiff',
43 'output_16_matte.tiff',
44 q//,
cristyd2cb5a92011-12-31 20:10:15 +000045 '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' );
cristy3ed852e2009-09-05 21:47:34 +000046
47#
48# 4) Test 8-bit pseudocolor + matte channel image
49#
50++$test;
51print("PseudoColor image (8 bits/sample + matte channel) ...\n");
52testReadWrite( 'input_256_matte.tiff',
53 'output_256_matte.tiff',
54 q//,
cristy18139f02012-03-11 17:51:02 +000055 '824af58cdd8a8accffee3dab1ed9d28b34a8b183d3e5f5f13caeaab03bcadd13',
cristyd2cb5a92011-12-31 20:10:15 +000056 'f3dc959e76f722bbc0a4338e2ed6650d73be3a81774c55210118531333fe6daa' );
cristy3ed852e2009-09-05 21:47:34 +000057
58#
59# 5) Test truecolor image
60#
61++$test;
62print("TrueColor image (8 bits/sample) ...\n");
63testReadWrite( 'input_truecolor.tiff',
64 'output_truecolor.tiff',
65 q/quality=>55/,
cristy11165b72011-09-28 17:26:49 +000066 '359291f6da6c9118bef6d75604be979b3267e4df0716e1bfc357f13cafd0acb8' );
cristy3ed852e2009-09-05 21:47:34 +000067
68#
69# 6) Test monochrome image
70#
71++$test;
72print("Gray image (1 bit per sample) ...\n");
73testReadWrite( 'input_mono.tiff',
74 'output_mono.tiff',
75 q//,
cristya5400d22012-05-27 00:36:31 +000076 '57fc672e7e231d3f92793d9b2073132def273f4be3115bcbed1c49a1c3131222' );
cristy3ed852e2009-09-05 21:47:34 +000077
78#
79# 7) Test gray 4 bit image
80#
81++$test;
82print("Gray image (4 bits per sample) ...\n");
83testReadWrite( 'input_gray_4bit.tiff',
84 'output_gray_4bit.tiff',
85 q//,
cristya5400d22012-05-27 00:36:31 +000086 'a3ae7f6908bb538751f59565dd17f28f83201620ca3ccc8a87a388b3d4c50232' );
cristy3ed852e2009-09-05 21:47:34 +000087
88#
89# 8) Test gray 8 bit image
90#
91++$test;
92print("Gray image (8 bits per sample) ...\n");
93testReadWrite( 'input_gray_8bit.tiff',
94 'output_gray_8bit.tiff',
95 q//,
cristya5400d22012-05-27 00:36:31 +000096 '63783c30b21fca4cc94bb6c02ae37df722224a466d997db39bb7ddece5e236a8' );
cristy3ed852e2009-09-05 21:47:34 +000097
98#
99# 9) Test gray 4 bit image (with matte channel)
100#
101++$test;
102print("Gray image (4 bits per sample + matte channel) ...\n");
103testReadWrite( 'input_gray_4bit_matte.tiff',
104 'output_gray_4bit_matte.tiff',
105 q//,
cristya5400d22012-05-27 00:36:31 +0000106 'e87923c84a9140824abbb3683d603c19e8b1b08b926d78f794c5ea813db53615' );
cristy3ed852e2009-09-05 21:47:34 +0000107
108#
109# 10) Test gray 8 bit image (with matte channel)
110#
111++$test;
112print("Gray image (8 bits per sample + matte channel) ...\n");
113testReadWrite( 'input_gray_8bit_matte.tiff',
114 'output_gray_8bit_matte.tiff',
115 q//,
cristya5400d22012-05-27 00:36:31 +0000116 'e87923c84a9140824abbb3683d603c19e8b1b08b926d78f794c5ea813db53615' );