1#!/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//, 24 '0de2dcbf667c69ae6735d1a701b4038c1eeea25cc86981a496bb26fc82541835'); 25 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//, 34 'b2644ac928730aa1d28e754aeb17b4731b57daea28c9fb89b1b50623e87215b5'); 35 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//, 44 '0de2dcbf667c69ae6735d1a701b4038c1eeea25cc86981a496bb26fc82541835' ); 45 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//, 54 'c8e5089f89ed3b7d067222e187ccd95da0a586f3a7f669876188fe8bfa04e6d9' ); 55 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/, 64 'f72b63be472e5e730ee2635463c6643d11057d251709ffe1f2027f69b57449df' ); 65 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//, 74 '71e1a6be223e307b1dbf732860792b15adba662b7a7ef284daf7f982f874ccf1' ); 75 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//, 84 'e55c01b0d28b0a19431ba27203db7cb6ada189c9519d4466c44a764aad5e185a' ); 85 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//, 94 'b51e862fcc24d439870da413c664dfefc36cea1260d807b3208d6f091566263c' ); 95 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//, 104 'aa1ccb94820722df3dbb8a84410b6e8f6d5a3e393e5b2204923a16182e0958b9' ); 105 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//, 114 '6002e57537cd54733551f8c4269e8104f2b14f8fcc58a07eda61f5911eb11c80' ); 115