Debian Codegraph @

PerlMagick/t/montage.t

raw
1
2 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3 # See the License for the specific language governing permissions and
4 # limitations under the License.
5 #
6 # Test montage method.
7 #
8 BEGIN { $| = 1; $test=1, print "1..19\n"; }
9 END {print "not ok 1\n" unless $loaded;}
10 use Image::Magick;
11 $loaded=1;
12
13 require 't/subroutines.pl';
14
15 chdir 't' || die 'Cd failed';
16
17 #
18 # 1) Test montage defaults (except no label that requires an exact font)
19 #
20 testMontage( q//,
21 q/background=>'#696e7e'/,
22 '6f8304c88f6dae4ade2a09fb7b4562cf2c09978cb30b025afaf9bd5805a4e75e');
23
24 #
25 # 2) Test Center gravity
26 # Image should be centered in frame
27 #
28 ++$test;
29 testMontage( q//,
30 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'Center'/,
31 '4fa94e68dc41fa0fda3469e6b8ebc4c07be6ef656405a1ea8f9ed8b00aa07552');
32
33 #
34 # 3) Test NorthWest gravity
35 # Image should be at top-left in frame
36 #
37 ++$test;
38 testMontage( q//,
39 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'NorthWest'/,
40 '24adcfa00f2c69d10fda815c9572bd7f621adb93a58a9c3c85657060929da4d0');
41
42 #
43 # 4) Test North gravity
44 # Image should be at top-center of frame
45 #
46 ++$test;
47 testMontage( q//,
48 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'North'/,
49 '70bb1be5bad21d5dd545ffe62eeb90052a037fcc1613aaa3f3b3c4d4c6138e8a');
50
51 #
52 # 5) Test NorthEast gravity
53 # Image should be at top-right of frame
54 #
55 ++$test;
56 testMontage( q//,
57 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'NorthEast'/,
58 '116668aedcc616527dabac2c07ea597d5cc26e3aaf33db14d8ce796892bc1f1c');
59
60 #
61 # 6) Test West gravity
62 # Image should be at left-center of frame
63 #
64 ++$test;
65 testMontage( q//,
66 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'West'/,
67 'abb3104224d07ba50235e750c8009b231a0e6aaa596fb2ec3703b2061a59abc3');
68
69 #
70 # 7) Test East gravity
71 # Image should be at right-center of frame.
72 #
73 ++$test;
74 testMontage( q//,
75 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'East'/,
76 '8723423ac9151136571b6e8f053fc60b09a8ec18d94e4fbc29c492de032c9a7d');
77
78 #
79 # 8) Test SouthWest gravity
80 # Image should be at bottom-left of frame
81 #
82 ++$test;
83 testMontage( q//,
84 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'SouthWest'/,
85 'abc713cef6d9923859854c164b83ed7b92f6c15ae6924207bb8a38063395650b');
86
87 #
88 # 9) Test South gravity
89 # Image should be at bottom of frame
90 #
91 ++$test;
92 testMontage( q//,
93 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'South'/,
94 '9992d5631703aa64d4fb87c71881df39aeff1cc821320d0a43f00897e7cd6a17');
95
96 #
97 # 10) Test SouthEast gravity
98 # Image should be at bottom-right of frame.
99 #
100 ++$test;
101 testMontage( q//,
102 q/background=>'#696e7e', geometry=>'90x80+5+5>', gravity=>'SouthEast'/,
103 'ae4322daebfbd3fe448afffe33aa599be518eaebb3515793e1efe6dc33939383');
104
105 #
106 # 11) Test Framed Montage
107 #
108 # Image border color 'bordercolor' controls frame background color
109 # Image matte color 'mattecolor' controls frame color
110 # Image pen color 'pen' controls label text foreground color
111 ++$test;
112 testMontage( q/bordercolor=>'blue', mattecolor=>'red'/,
113 q/background=>'#696e7e', tile=>'4x4', geometry=>'90x80+3+3>', frame=>'8x10',
114 borderwidth=>'0', gravity=>'Center', background=>'gray'/,
115 'dcf3971caf73a0d7a7e3dd5c231622f7350da6a02addfb2eb1a9ebce75246f88',
116 '40835871b13232243ba4d2bcb244d06958556a24a9624e793f5c4c291d64f322',
117 '531d0d485d55a5b585cab3f64b37da81a109fbaa91aa44a038fa916421780f14',
118 '531d0d485d55a5b585cab3f64b37da81a109fbaa91aa44a038fa916421780f14',
119 '531d0d485d55a5b585cab3f64b37da81a109fbaa91aa44a038fa916421780f14');
120
121 #
122 # 12) Test Framed Montage with drop-shadows
123 #
124 ++$test;
125 testMontage( q/bordercolor=>'blue', mattecolor=>'red'/,
126 q/background=>'#696e7e', tile=>'4x4', geometry=>'90x80+6+6>', frame=>'8x10',
127 borderwidth=>'0', gravity=>'Center', shadow=>'True',background=>'gray'/,
128 'f338c5218bf2dba47490d453bd845ed7b6e6c146079f662265338baedcd473ee',
129 '40d6c29a9e85135eed35cf47b79cdfd8091f4a72459fbea0cc80f94bfff87d88',
130 '420aecbcab063e2735156a2b4d0b96e89d1b89dd84d3b2f217c9cf980f25939c',
131 '16d83700b4dabac353bcc557aa2581659a07f71e8098b550f5ef241b6d1ab9e6',
132 'ab9588dcdd480f7a792ecc3202b0af5d9c8bd900eee1447f0c6ef1cedee3b140');
133
134 #
135 # 13) Test Framed Montage with drop-shadows and background texture
136 #
137 ++$test;
138 testMontage( q/bordercolor=>'blue', mattecolor=>'red'/,
139 q/background=>'#696e7e', tile=>'4x4', geometry=>'90x80+6+6>', frame=>'8x10',
140 borderwidth=>'0', gravity=>'Center', shadow=>'True', texture=>'granite:'/,
141 'b2be2edbc68a4b828392f5fbf2683a16e63d81bcd5c2c77e8aa1573c4a37b23b',
142 '9a23ef5366121cee8d101af2d6def5920b4984ce8e37f5e46db8fd5b18c47896',
143 'c10b9d30b4a3312df15f4a55c195992670dd22d59dbf2c4e3436ad730d647ed2',
144 '6a7b56ca2e9f7e7308f1794b1556c2f87c3ba6050f84bfbeb61a7ccad2b3de9b',
145 '4a2b769973f9e0682004307cf8c999d1476404e5c85712e6fe8e77af6699289d');
146
147 #
148 # 14) Test Un-bordered, Un-framed Montage
149 #
150 ++$test;
151 testMontage( q//,
152 q/background=>'#696e7e', tile=>'4x4', geometry=>'90x80+6+6>', mode=>'Unframe',
153 borderwidth=>'0', gravity=>'Center', background=>'gray'/,
154 'b9df49be9b056ed8fd4c4eb7621aa073df65740e4aaebc038c294cb3731f334f');
155
156 #
157 # 15) Test Bordered, Un-framed Montage (mode=>'Unframe')
158 #
159 ++$test;
160 testMontage( q/bordercolor=>'red'/,
161 q/background=>'#696e7e', tile=>'4x4', geometry=>'90x80+6+6>', mode=>'Unframe',
162 borderwidth=>'5', gravity=>'Center', background=>'gray'/,
163 '9d7d0f1886ef8d48f680567163d3a4583897d114c7abbb9da6a98f96fb629ebb');
164
165 #
166 # 16) Test Bordered, Un-framed Montage (mode=>'UnFrame')
167 #
168 ++$test;
169 testMontage( q/bordercolor=>'red'/,
170 q/ tile=>'4x4', geometry=>'90x80+6+6>', mode=>'UnFrame',
171 borderwidth=>'5', gravity=>'Center', background=>'gray'/,
172 '9d7d0f1886ef8d48f680567163d3a4583897d114c7abbb9da6a98f96fb629ebb');
173
174 #
175 # 17) Test Un-bordered, Un-framed Montage with 16x1 tile
176 #
177 ++$test;
178 testMontage( q//,
179 q/background=>'#696e7e', tile=>'16x1', geometry=>'90x80+0+0>', mode=>'Unframe',
180 borderwidth=>'0', gravity=>'Center', background=>'gray'/,
181 '9f6f0c7ff76283b0f8747c1e12bd810bda0c47ab8cf78a4ae584556a64c88213');
182
183 #
184 # 18) Test concatenated thumbnail Montage (concatenated via special Concatenate mode)
185 # Thumbnails should be compacted tightly together in a grid
186 #
187 ++$test;
188 testMontage( q//,
189 q/background=>'#696e7e', tile=>'4x4', geometry=>'90x80>', mode=>'Concatenate'/,
190 'dfede51035a4ce942e3ba9909f85eb497c134a60bb8363afded0ae81f73f0e46');
191 #
192 # 19) Test concatenated thumbnail Montage (concatenated by setting params to zero)
193 # Thumbnails should be compacted tightly together in a grid
194 #
195 ++$test;
196 testMontage( q//,
197 q/background=>'#696e7e', tile=>'4x4', geometry=>'+0+0', mode=>'Unframe', shadow=>'False',
198 borderwidth=>'0', background=>'gray'/,
199 'dfede51035a4ce942e3ba9909f85eb497c134a60bb8363afded0ae81f73f0e46');