1 #!/usr/bin/perl 2 # 3 # Test writing TIFF images 4 # 5 # Contributed by Bob Friesenhahn <bfriesen (at] 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//, 24 '58a82998d620aba54b86ab8dca7cbfeb726f3e86842369d5a0292a8522e95dab'); 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//, 34 'ec6408aba63b43dfc594b4bd766e43457754bb2382a02c170e3d085366e9a6f4', 35 '59c97ab49c16b8664f1362242548399ad9e902b96959db98540ec820484380b1'); 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//, 45 '58a82998d620aba54b86ab8dca7cbfeb726f3e86842369d5a0292a8522e95dab' ); 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//, 55 '824af58cdd8a8accffee3dab1ed9d28b34a8b183d3e5f5f13caeaab03bcadd13', 56 '64b8429356cf9ea2b717faaa28a85b0f7ca174ea1a72063c1d4b2270084e4881' ); 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/, 66 '2c5f5bcc5168543b807bf50476e472cd38e8d1a7d2c68df91e25ae7cd001166a' ); 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//, 76 'dedb5873a990158f0e5abdebda8c8dfb32de0be16b2b191fcb476b754e000a7b' ); 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//, 86 '3d58e49ad202f2b171214f7a0e8ebdc2ac2c7e45b68a2249502f9339ca7efc6e' ); 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//, 96 '76f4dd783661899ede132a87a7c68132462d0a60efe92906388c3aca1fb76130' ); 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//, 106 '817ebd9cb521eca754aa3add8100be1b7865dc54510b830d67a57c254832d3d5' ); 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//, 116 '30206f5082b53a8f81d1b0e5dfec94b3513b15ee3fe87fb646a7fd5bf9c94c04' ); 117