Debian Codegraph @

PerlMagick/t/write.t

raw
1 #!/usr/bin/perl
2 # Copyright 1999 ImageMagick Studio LLC, a non-profit organization
3 # dedicated to making software imaging solutions freely available.
4 #
5 # You may not use this file except in compliance with the License. You may
6 # obtain a copy of the License at
7 #
8 # https://imagemagick.org/license/
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # Test writing formats supported directly by ImageMagick
17 #
18
19 BEGIN { $| = 1; $test=1; print "1..32\n"; }
20 END {print "not ok $test\n" unless $loaded;}
21 use Image::Magick;
22 $loaded=1;
23
24 require 't/subroutines.pl';
25
26 chdir 't' || die 'Cd failed';
27
28 print("AVS X image file ...\n");
29 testReadWrite( 'AVS:input.avs',
30 'AVS:output.avs',
31 q//,
32 '74136c90d3e699ea5bcbf4aa733aff0dc822b6af72fce00f0c7647bcb0d49f66');
33
34 print("Microsoft Windows bitmap image file ...\n");
35 ++$test;
36 testReadWrite( 'BMP:input.bmp',
37 'BMP:output.bmp',
38 q//,
39 'd7324c919f04f4c118da68061a5dbb3f07ebab76b471ecfb0ac822453f677983');
40
41 print("Microsoft Windows 24-bit bitmap image file ...\n");
42 ++$test;
43 testReadWrite( 'BMP:input.bmp24',
44 'BMP:output.bmp24',
45 q//,
46 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
47
48 print("ZSoft IBM PC multi-page Paintbrush file ...\n");
49 ++$test;
50 testReadWrite( 'DCX:input.dcx',
51 'DCX:output.dcx',
52 q//,
53 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
54
55 print("Microsoft Windows 3.X DIB file ...\n");
56 ++$test;
57 testReadWrite( 'DIB:input.dib',
58 'DIB:output.dib',
59 q//,
60 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
61
62 print("Flexible Image Transport System ...\n");
63 ++$test;
64 testReadWrite( 'FITS:input.fits',
65 'FITS:output.fits',
66 q//,
67 '1c773aeac90d47c684c5170fcee16e0c8d4b399f76809c97bcd92ea7e47b1ab4' );
68
69 print("CompuServe graphics interchange format ...\n");
70 ++$test;
71 testReadWrite( 'GIF:input.gif',
72 'GIF:output.gif',
73 q//,
74 'd7324c919f04f4c118da68061a5dbb3f07ebab76b471ecfb0ac822453f677983');
75
76 print("CompuServe graphics interchange format (1987) ...\n");
77 ++$test;
78 testReadWrite( 'GIF87:input.gif87',
79 'GIF87:output.gif87',
80 q//,
81 '153b1c806e673a635edc645a92c60d565b58a2aec2417cee1f2e507d8ede27e4');
82
83 print("Magick image file format ...\n");
84 ++$test;
85 testReadWrite( 'MIFF:input.miff',
86 'MIFF:output.miff',
87 q//,
88 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
89
90 print("MTV Raytracing image format ...\n");
91 ++$test;
92 testReadWrite( 'MTV:input.mtv',
93 'MTV:output.mtv',
94 q//,
95 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
96
97 print("Portable bitmap format (black and white), ASCII format ...\n");
98 ++$test;
99 testReadWrite( 'PBM:input_p1.pbm',
100 'PBM:output_p1.pbm',
101 q/compression=>'None'/,
102 '71e1a6be223e307b1dbf732860792b15adba662b7a7ef284daf7f982f874ccf1');
103
104 print("Portable bitmap format (black and white), binary format ...\n");
105 ++$test;
106 testReadWrite( 'PBM:input_p4.pbm',
107 'PBM:output_p4.pbm',
108 q//,
109 '71e1a6be223e307b1dbf732860792b15adba662b7a7ef284daf7f982f874ccf1');
110
111 print("ZSoft IBM PC Paintbrush file ...\n");
112 ++$test;
113 testReadWrite( 'PCX:input.pcx',
114 'PCX:output.pcx',
115 q//,
116 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
117
118 print("Portable graymap format (gray scale), ASCII format ...\n");
119 ++$test;
120 testReadWrite( 'PGM:input_p2.pgm',
121 'PGM:output_p2.pgm',
122 q/compression=>'None'/,
123 'f345fd06540c055028fd51b1d97a2144065dda8036ff23234313ed66f0b87254');
124
125 print("Apple Macintosh QuickDraw/PICT file ...\n");
126 ++$test;
127 testReadWrite( 'PICT:input.pict',
128 'PICT:output.pict',
129 q//,
130 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
131
132 print("Portable pixmap format (color), ASCII format ...\n");
133 ++$test;
134 testReadWrite( 'PPM:input_p3.ppm',
135 'PPM:output_p3.ppm',
136 q/compression=>'None'/,
137 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
138
139 print("Portable graymap format (gray scale), binary format ...\n");
140 ++$test;
141 testReadWrite( 'PGM:input_p5.pgm',
142 'PGM:output_p5.pgm',
143 q//,
144 'f345fd06540c055028fd51b1d97a2144065dda8036ff23234313ed66f0b87254');
145
146 print("Portable pixmap format (color), binary format ...\n");
147 ++$test;
148 testReadWrite( 'PPM:input_p6.ppm',
149 'PPM:output_p6.ppm',
150 q//,
151 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
152
153 print("Adobe Photoshop bitmap file ...\n");
154 ++$test;
155 testReadWrite( 'PSD:input.psd',
156 'PSD:output.psd',
157 q//,
158 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52' );
159
160 print("Irix RGB image file ...\n");
161 ++$test;
162 testReadWrite( 'SGI:input.sgi',
163 'SGI:output.sgi',
164 q//,
165 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
166
167 print("SUN 1-bit Rasterfile ...\n");
168 ++$test;
169 testReadWrite( 'SUN:input.im1',
170 'SUN:output.im1',
171 q//,
172 '49d4c40abae73a1d6169dc1f0262e89ad5dc8a9f64e7feef3430090768e629c4');
173
174 print("SUN 8-bit Rasterfile ...\n");
175 ++$test;
176 testReadWrite( 'SUN:input.im8',
177 'SUN:output.im8',
178 q//,
179 '8ac3392ac643d8a852a4ac23dbf25f2124cb13627dbc60bf887b76ecb89cbb20');
180
181 print("SUN True-Color Rasterfile ...\n");
182 ++$test;
183 testReadWrite( 'SUN:input.im24',
184 'SUN:output.im24',
185 q//,
186 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');
187
188 print("Truevision Targa image file ...\n");
189 ++$test;
190 testReadWrite( 'TGA:input.tga',
191 'TGA:output.tga',
192 q//,
193 'ff78a650ff5f4adfdf6ef34e8cc3369de44e71ed4eef1807dc88372352ddac90');
194
195 print("Khoros Visualization image file ...\n");
196 ++$test;
197 testReadWrite( 'VIFF:input.viff',
198 'VIFF:output.viff',
199 q//,
200 'b9ff3e1dbb1a4cd376e95645c0f0f950e3ae73973780bb1dfbc849b211fc3925');
201
202 print("WBMP (Wireless Bitmap (level 0) image) ...\n");
203 ++$test;
204 testReadWrite( 'WBMP:input.wbmp',
205 'WBMP:output.wbmp',
206 q//,
207 '8833a92cbe11a3b925a1b7edffd6508d7b12dd50e3f4907ca8d77917f6e4e697');
208
209 print("X Windows system bitmap (black and white only) ...\n");
210 ++$test;
211 testReadWrite( 'XBM:input.xbm',
212 'XBM:output.xbm',
213 q//,
214 '49d4c40abae73a1d6169dc1f0262e89ad5dc8a9f64e7feef3430090768e629c4');
215
216 print("X Windows system pixmap file (color) ...\n");
217 ++$test;
218 testReadWrite( 'XPM:input.xpm',
219 'XPM:output.xpm',
220 q//,
221 '8ac3392ac643d8a852a4ac23dbf25f2124cb13627dbc60bf887b76ecb89cbb20');
222
223 print("CMYK format ...\n");
224 ++$test;
225 testReadWriteSized( 'CMYK:input_70x46.cmyk',
226 'CMYK:output_70x46.cmyk',
227 '70x46',
228 8,
229 q//,
230 '215166c965254211b75dcaadbb587b4c2947d7cb3de1420b13b6539cd815a90d');
231
232 print("GRAY format ...\n");
233 ++$test;
234 testReadWriteSized( 'GRAY:input_70x46.gray',
235 'GRAY:output_70x46.gray',
236 '70x46',
237 8,
238 q//,
239 '2f3d94bebb0feec1a2f0dcc295cbcf074ceb58e7e59262c3d23f0f26fd5e6267' );
240
241 print("RGB format ...\n");
242 ++$test;
243 testReadWriteSized( 'RGB:input_70x46.rgb',
244 'RGB:output_70x46.rgb',
245 '70x46',
246 8,
247 q//,
248 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52' );
249
250 print("RGBA format ...\n");
251 ++$test;
252 testReadWriteSized( 'RGBA:input_70x46.rgba',
253 'RGBA:output_70x46.rgba',
254 '70x46',
255 8,
256 q//,
257 '74136c90d3e699ea5bcbf4aa733aff0dc822b6af72fce00f0c7647bcb0d49f66' );
258
259 1;