cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | #!/usr/bin/perl |
| 2 | # |
| 3 | # Test writing TIFF images |
| 4 | # |
| 5 | # Contributed by Bob Friesenhahn <bfriesen@simple.dallas.tx.us> |
| 6 | # |
| 7 | BEGIN { $| = 1; $test=1; print "1..10\n"; } |
| 8 | END {print "not ok $test\n" unless $loaded;} |
| 9 | |
| 10 | use Image::Magick; |
| 11 | $loaded=1; |
| 12 | |
| 13 | require 't/subroutines.pl'; |
| 14 | |
| 15 | chdir 't/tiff' || die 'Cd failed'; |
| 16 | |
| 17 | # |
| 18 | # 1) Test 4-bit pseudocolor image |
| 19 | # |
| 20 | print("PseudoColor image (4 bits/sample) ...\n"); |
| 21 | testReadWrite( 'input_16.tiff', |
| 22 | 'output_16.tiff', |
| 23 | q//, |
cristy | d2cb5a9 | 2011-12-31 20:10:15 +0000 | [diff] [blame] | 24 | '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4'); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 25 | |
| 26 | # |
| 27 | # 2) Test 8-bit pseudocolor image |
| 28 | # |
| 29 | ++$test; |
| 30 | print("PseudoColor image (8 bits/sample) ...\n"); |
| 31 | testReadWrite( 'input_256.tiff', |
| 32 | 'output_256.tiff', |
| 33 | q//, |
cristy | 18139f0 | 2012-03-11 17:51:02 +0000 | [diff] [blame^] | 34 | 'ec6408aba63b43dfc594b4bd766e43457754bb2382a02c170e3d085366e9a6f4', |
cristy | d2cb5a9 | 2011-12-31 20:10:15 +0000 | [diff] [blame] | 35 | '1280e7ed7094aaae47c0be1cb0b6d33660e59483a5500f5f40e34940346f7847'); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 36 | |
| 37 | # |
| 38 | # 3) Test 4-bit pseudocolor + matte channel image |
| 39 | # |
| 40 | ++$test; |
| 41 | print("PseudoColor image (4 bits/sample + matte channel) ...\n"); |
| 42 | testReadWrite( 'input_16_matte.tiff', |
| 43 | 'output_16_matte.tiff', |
| 44 | q//, |
cristy | d2cb5a9 | 2011-12-31 20:10:15 +0000 | [diff] [blame] | 45 | '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4' ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 46 | |
| 47 | # |
| 48 | # 4) Test 8-bit pseudocolor + matte channel image |
| 49 | # |
| 50 | ++$test; |
| 51 | print("PseudoColor image (8 bits/sample + matte channel) ...\n"); |
| 52 | testReadWrite( 'input_256_matte.tiff', |
| 53 | 'output_256_matte.tiff', |
| 54 | q//, |
cristy | 18139f0 | 2012-03-11 17:51:02 +0000 | [diff] [blame^] | 55 | '824af58cdd8a8accffee3dab1ed9d28b34a8b183d3e5f5f13caeaab03bcadd13', |
cristy | d2cb5a9 | 2011-12-31 20:10:15 +0000 | [diff] [blame] | 56 | 'f3dc959e76f722bbc0a4338e2ed6650d73be3a81774c55210118531333fe6daa' ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 57 | |
| 58 | # |
| 59 | # 5) Test truecolor image |
| 60 | # |
| 61 | ++$test; |
| 62 | print("TrueColor image (8 bits/sample) ...\n"); |
| 63 | testReadWrite( 'input_truecolor.tiff', |
| 64 | 'output_truecolor.tiff', |
| 65 | q/quality=>55/, |
cristy | 11165b7 | 2011-09-28 17:26:49 +0000 | [diff] [blame] | 66 | '359291f6da6c9118bef6d75604be979b3267e4df0716e1bfc357f13cafd0acb8' ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 67 | |
| 68 | # |
| 69 | # 6) Test monochrome image |
| 70 | # |
| 71 | ++$test; |
| 72 | print("Gray image (1 bit per sample) ...\n"); |
| 73 | testReadWrite( 'input_mono.tiff', |
| 74 | 'output_mono.tiff', |
| 75 | q//, |
cristy | b241f38 | 2012-01-01 01:45:57 +0000 | [diff] [blame] | 76 | 'c8c4f812d902693d1de6c74a6cffaaef7506bd868df65cae63b06707f2c9f3ac' ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 77 | |
| 78 | # |
| 79 | # 7) Test gray 4 bit image |
| 80 | # |
| 81 | ++$test; |
| 82 | print("Gray image (4 bits per sample) ...\n"); |
| 83 | testReadWrite( 'input_gray_4bit.tiff', |
| 84 | 'output_gray_4bit.tiff', |
| 85 | q//, |
cristy | b241f38 | 2012-01-01 01:45:57 +0000 | [diff] [blame] | 86 | 'be370e06f1aad47490e88b5212002c89520b07af6764690b3cee4cb9f1343df9' ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 87 | |
| 88 | # |
| 89 | # 8) Test gray 8 bit image |
| 90 | # |
| 91 | ++$test; |
| 92 | print("Gray image (8 bits per sample) ...\n"); |
| 93 | testReadWrite( 'input_gray_8bit.tiff', |
| 94 | 'output_gray_8bit.tiff', |
| 95 | q//, |
cristy | b241f38 | 2012-01-01 01:45:57 +0000 | [diff] [blame] | 96 | '9bd950a80339e260c491025f5c58a21ca70c38e2c498914feda6558bfa1ffe35' ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 97 | |
| 98 | # |
| 99 | # 9) Test gray 4 bit image (with matte channel) |
| 100 | # |
| 101 | ++$test; |
| 102 | print("Gray image (4 bits per sample + matte channel) ...\n"); |
| 103 | testReadWrite( 'input_gray_4bit_matte.tiff', |
| 104 | 'output_gray_4bit_matte.tiff', |
| 105 | q//, |
cristy | b241f38 | 2012-01-01 01:45:57 +0000 | [diff] [blame] | 106 | 'b3bb4c5f125ef81e68c038fe6ff3b1cd932e759bf2555a4d4746074859d90ee3' ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 107 | |
| 108 | # |
| 109 | # 10) Test gray 8 bit image (with matte channel) |
| 110 | # |
| 111 | ++$test; |
| 112 | print("Gray image (8 bits per sample + matte channel) ...\n"); |
| 113 | testReadWrite( 'input_gray_8bit_matte.tiff', |
| 114 | 'output_gray_8bit_matte.tiff', |
| 115 | q//, |
cristy | b241f38 | 2012-01-01 01:45:57 +0000 | [diff] [blame] | 116 | 'c34ac18bc2c04aa5d2577c579a620a1223e2249018ed6303cf08282f578d59c9' ); |