1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
#!/usr/local/bin/perl
#
# Test writing TIFF images
#
# Contributed by Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
#
BEGIN { $| = 1; $test=1; print "1..10\n"; }
END {print "not ok $test\n" unless $loaded;}
use Image::Magick;
$loaded=1;
require 't/subroutines.pl';
chdir 't/tiff' || die 'Cd failed';
#
# 1) Test 4-bit pseudocolor image
#
print("PseudoColor image (4 bits/sample) ...\n");
testReadWrite( 'input_16.tiff',
'output_16.tiff',
q//,
'eff9f8087197689c717ee4678bc242d2973c569c20dd29bc23631f5f0d0cb058');
#
# 2) Test 8-bit pseudocolor image
#
++$test;
print("PseudoColor image (8 bits/sample) ...\n");
testReadWrite( 'input_256.tiff',
'output_256.tiff',
q//,
'af0e4541c30c01c9f3527a87e5ea06912ade17dea3d3295028b87b856ec21558');
#
# 3) Test 4-bit pseudocolor + matte channel image
#
++$test;
print("PseudoColor image (4 bits/sample + matte channel) ...\n");
testReadWrite( 'input_16_matte.tiff',
'output_16_matte.tiff',
q//,
'02852e581ccb4713acf82b99853ac75ca3510af29bc01de221d73ce8940b3b59',
'02852e581ccb4713acf82b99853ac75ca3510af29bc01de221d73ce8940b3b59',
'f30abaca227e9a5e27d1d011d2463ff894e2fb34e696f428fb0f1dd7e1e514d3' );
#
# 4) Test 8-bit pseudocolor + matte channel image
#
++$test;
print("PseudoColor image (8 bits/sample + matte channel) ...\n");
testReadWrite( 'input_256_matte.tiff',
'output_256_matte.tiff',
q//,
'01f9d29ebea733fb815dcccfa1fb769cf223d60d8bfbce47b8329d119587de15',
'01f9d29ebea733fb815dcccfa1fb769cf223d60d8bfbce47b8329d119587de15' );
#
# 5) Test truecolor image
#
++$test;
print("TrueColor image (8 bits/sample) ...\n");
testReadWrite( 'input_truecolor.tiff',
'output_truecolor.tiff',
q/quality=>55/,
'6452b611f3bf10ebe0f4809b6e27570931bc982d6c3993e28ab3d27527b182fa' );
#
# 6) Test monochrome image
#
++$test;
print("Gray image (1 bit per sample) ...\n");
testReadWrite( 'input_mono.tiff',
'output_mono.tiff',
q//,
'1eb1f91d284e0b19af6610a8e3884a87178353a850287b63a0dabe8570a83e3f' );
#
# 7) Test gray 4 bit image
#
++$test;
print("Gray image (4 bits per sample) ...\n");
testReadWrite( 'input_gray_4bit.tiff',
'output_gray_4bit.tiff',
q//,
'a23eabe8f0c6aa3ae4e7ef2e6a86d37befe8d8cc83ad3ede010eca25275ba478' );
#
# 8) Test gray 8 bit image
#
++$test;
print("Gray image (8 bits per sample) ...\n");
testReadWrite( 'input_gray_8bit.tiff',
'output_gray_8bit.tiff',
q//,
'a3880cab9837b975d6f62116811a28578cef871c4879403a105e3d946160a078' );
#
# 9) Test gray 4 bit image (with matte channel)
#
++$test;
print("Gray image (4 bits per sample + matte channel) ...\n");
testReadWrite( 'input_gray_4bit_matte.tiff',
'output_gray_4bit_matte.tiff',
q//,
'dfb7df2b15318a2e92096ca6177e22fa20ca1d37b660cbd4d880e12e2ff0bd04',
'dfb7df2b15318a2e92096ca6177e22fa20ca1d37b660cbd4d880e12e2ff0bd04',
'20fc50f858dcd84aeb29097fe8067f2f0b8059d535d81fcdf51045f28aebe905' );
#
# 10) Test gray 8 bit image (with matte channel)
#
++$test;
print("Gray image (8 bits per sample + matte channel) ...\n");
testReadWrite( 'input_gray_8bit_matte.tiff',
'output_gray_8bit_matte.tiff',
q//,
'1d09012a9334266bc64255cfc8305a89afba602a93e29bec0c793851f8bb01e7',
'9005d4c7dc1dc92a54179386c8c6dc6b5bc11de6bc8d9741f2f4a5260b60c8d9' );
|