blob: 97ffa86d410db1c58adab3ba69e2fae4e7c75abb [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001#!/usr/bin/perl
cristy1454be72011-12-19 01:52:48 +00002# Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003# 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# http://www.imagemagick.org/script/license.php
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
19BEGIN { $| = 1; $test=1; print "1..32\n"; }
20END {print "not ok $test\n" unless $loaded;}
21use Image::Magick;
22$loaded=1;
23
24require 't/subroutines.pl';
25
26chdir 't' || die 'Cd failed';
27
28print("AVS X image file ...\n");
29testReadWrite( 'AVS:input.avs',
30 'AVS:output.avs',
31 q//,
cristyd2cb5a92011-12-31 20:10:15 +000032 'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3');
cristy3ed852e2009-09-05 21:47:34 +000033
34print("Microsoft Windows bitmap image file ...\n");
35++$test;
36testReadWrite( 'BMP:input.bmp',
37 'BMP:output.bmp',
38 q//,
cristyd2cb5a92011-12-31 20:10:15 +000039 'ae2007d0e05933a72294a6f8c7b59fc54d5fa3039f0f13bf8d65d05044ef2f39');
cristy3ed852e2009-09-05 21:47:34 +000040
41print("Microsoft Windows 24-bit bitmap image file ...\n");
42++$test;
43testReadWrite( 'BMP:input.bmp24',
44 'BMP:output.bmp24',
45 q//,
cristy11165b72011-09-28 17:26:49 +000046 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +000047
cristy3ed852e2009-09-05 21:47:34 +000048print("ZSoft IBM PC multi-page Paintbrush file ...\n");
49++$test;
50testReadWrite( 'DCX:input.dcx',
51 'DCX:output.dcx',
52 q//,
cristy11165b72011-09-28 17:26:49 +000053 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +000054
55print("Microsoft Windows 3.X DIB file ...\n");
56++$test;
57testReadWrite( 'DIB:input.dib',
58 'DIB:output.dib',
59 q//,
cristy11165b72011-09-28 17:26:49 +000060 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +000061
62print("Flexible Image Transport System ...\n");
63++$test;
64testReadWrite( 'FITS:input.fits',
65 'FITS:output.fits',
66 q//,
cristy11165b72011-09-28 17:26:49 +000067 'f28470f09857477a372a743665071cdc325613b963481d94b6dceabe292dd469' );
cristy3ed852e2009-09-05 21:47:34 +000068
69print("CompuServe graphics interchange format ...\n");
70++$test;
71testReadWrite( 'GIF:input.gif',
72 'GIF:output.gif',
73 q//,
cristyd2cb5a92011-12-31 20:10:15 +000074 'ae2007d0e05933a72294a6f8c7b59fc54d5fa3039f0f13bf8d65d05044ef2f39');
cristy3ed852e2009-09-05 21:47:34 +000075
76print("CompuServe graphics interchange format (1987) ...\n");
77++$test;
78testReadWrite( 'GIF87:input.gif87',
79 'GIF87:output.gif87',
80 q//,
cristyd2cb5a92011-12-31 20:10:15 +000081 'a037bce490abf358b3c8e1f471a83d15434da26d6c91aa6d761407c0df573f1d');
cristy3ed852e2009-09-05 21:47:34 +000082
83print("Magick image file format ...\n");
84++$test;
85testReadWrite( 'MIFF:input.miff',
86 'MIFF:output.miff',
87 q//,
cristy11165b72011-09-28 17:26:49 +000088 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +000089
90print("MTV Raytracing image format ...\n");
91++$test;
92testReadWrite( 'MTV:input.mtv',
93 'MTV:output.mtv',
94 q//,
cristy11165b72011-09-28 17:26:49 +000095 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +000096
97print("Portable bitmap format (black and white), ASCII format ...\n");
98++$test;
99testReadWrite( 'PBM:input_p1.pbm',
100 'PBM:output_p1.pbm',
101 q/compression=>'None'/,
cristy11165b72011-09-28 17:26:49 +0000102 '57fc672e7e231d3f92793d9b2073132def273f4be3115bcbed1c49a1c3131222');
cristy3ed852e2009-09-05 21:47:34 +0000103
104print("Portable bitmap format (black and white), binary format ...\n");
105++$test;
106testReadWrite( 'PBM:input_p4.pbm',
107 'PBM:output_p4.pbm',
108 q//,
cristy11165b72011-09-28 17:26:49 +0000109 '57fc672e7e231d3f92793d9b2073132def273f4be3115bcbed1c49a1c3131222');
cristy3ed852e2009-09-05 21:47:34 +0000110
111print("ZSoft IBM PC Paintbrush file ...\n");
112++$test;
113testReadWrite( 'PCX:input.pcx',
114 'PCX:output.pcx',
115 q//,
cristy11165b72011-09-28 17:26:49 +0000116 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +0000117
118print("Portable graymap format (gray scale), ASCII format ...\n");
119++$test;
120testReadWrite( 'PGM:input_p2.pgm',
121 'PGM:output_p2.pgm',
122 q/compression=>'None'/,
cristy11165b72011-09-28 17:26:49 +0000123 'e2e1b058a09c2b9c0c696996163911dcce325def773cb2a1554c6f21a0391ff7');
cristy3ed852e2009-09-05 21:47:34 +0000124
125print("Apple Macintosh QuickDraw/PICT file ...\n");
126++$test;
127testReadWrite( 'PICT:input.pict',
128 'PICT:output.pict',
129 q//,
cristy11165b72011-09-28 17:26:49 +0000130 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +0000131
132print("Portable pixmap format (color), ASCII format ...\n");
133++$test;
134testReadWrite( 'PPM:input_p3.ppm',
135 'PPM:output_p3.ppm',
136 q/compression=>'None'/,
cristy11165b72011-09-28 17:26:49 +0000137 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +0000138
139print("Portable graymap format (gray scale), binary format ...\n");
140++$test;
141testReadWrite( 'PGM:input_p5.pgm',
142 'PGM:output_p5.pgm',
143 q//,
cristy11165b72011-09-28 17:26:49 +0000144 'e2e1b058a09c2b9c0c696996163911dcce325def773cb2a1554c6f21a0391ff7');
cristy3ed852e2009-09-05 21:47:34 +0000145
146print("Portable pixmap format (color), binary format ...\n");
147++$test;
148testReadWrite( 'PPM:input_p6.ppm',
149 'PPM:output_p6.ppm',
150 q//,
cristy11165b72011-09-28 17:26:49 +0000151 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +0000152
153print("Adobe Photoshop bitmap file ...\n");
154++$test;
155testReadWrite( 'PSD:input.psd',
156 'PSD:output.psd',
157 q//,
cristy11165b72011-09-28 17:26:49 +0000158 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33' );
cristy3ed852e2009-09-05 21:47:34 +0000159
160print("Irix RGB image file ...\n");
161++$test;
162testReadWrite( 'SGI:input.sgi',
163 'SGI:output.sgi',
164 q//,
cristy11165b72011-09-28 17:26:49 +0000165 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +0000166
167print("SUN 1-bit Rasterfile ...\n");
168++$test;
169testReadWrite( 'SUN:input.im1',
170 'SUN:output.im1',
171 q//,
cristyd2cb5a92011-12-31 20:10:15 +0000172 'cf6e645339d1bb82131ad658f2e7521f1e8aac69eb6e7add728f6157489972cd');
cristy3ed852e2009-09-05 21:47:34 +0000173
174print("SUN 8-bit Rasterfile ...\n");
175++$test;
176testReadWrite( 'SUN:input.im8',
177 'SUN:output.im8',
178 q//,
cristyd2cb5a92011-12-31 20:10:15 +0000179 '6b894bae0411f6f21e76724047cc93e28a2b04176df31d0632b656e98ce9b6e8');
cristy3ed852e2009-09-05 21:47:34 +0000180
181print("SUN True-Color Rasterfile ...\n");
182++$test;
183testReadWrite( 'SUN:input.im24',
184 'SUN:output.im24',
185 q//,
cristy11165b72011-09-28 17:26:49 +0000186 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33',
187 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33',
cristy3ed852e2009-09-05 21:47:34 +0000188 '5a5f94a626ee1945ab1d4d2a621aeec4982cccb94e4d68afe4c784abece91b3e');
189
190print("Truevision Targa image file ...\n");
191++$test;
192testReadWrite( 'TGA:input.tga',
193 'TGA:output.tga',
194 q//,
cristy11165b72011-09-28 17:26:49 +0000195 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
cristy3ed852e2009-09-05 21:47:34 +0000196
197print("Khoros Visualization image file ...\n");
198++$test;
199testReadWrite( 'VIFF:input.viff',
200 'VIFF:output.viff',
201 q//,
202 '7f2c98e7ce98983509580eaeb3bb6a420e3f358b39fcec4cdd96982ae1e21882',
cristyd2cb5a92011-12-31 20:10:15 +0000203 'bbeaa063bd13c74414a9962f21a795844661b596bd89f753f064ba1db2624d03',
cristy3ed852e2009-09-05 21:47:34 +0000204 'aa4a6154f3c314d99c257280faf9097f3863a132ec8bddbc3b68209ce2c19487');
205
206print("WBMP (Wireless Bitmap (level 0) image) ...\n");
207++$test;
208testReadWrite( 'WBMP:input.wbmp',
209 'WBMP:output.wbmp',
210 q//,
211 'b7b682361e82d9d7cf2bed34f76af87576b97590b12d76b961104e53ee18ee74',
cristyd2cb5a92011-12-31 20:10:15 +0000212 '6d1374fa22aa5cb8fa9e98b928b8dea6e5fc6606ed2dc07c5f27d1e03e494d0e',
cristy3ed852e2009-09-05 21:47:34 +0000213 'd818195f73f8d5db624c8f87a706bbcb3179dbb7a7f08abbad5b12cd97de8fe6');
214
215print("X Windows system bitmap (black and white only) ...\n");
216++$test;
217testReadWrite( 'XBM:input.xbm',
218 'XBM:output.xbm',
219 q//,
cristyd2cb5a92011-12-31 20:10:15 +0000220 'cf6e645339d1bb82131ad658f2e7521f1e8aac69eb6e7add728f6157489972cd');
cristy3ed852e2009-09-05 21:47:34 +0000221
222print("X Windows system pixmap file (color) ...\n");
223++$test;
224testReadWrite( 'XPM:input.xpm',
225 'XPM:output.xpm',
226 q//,
cristyd2cb5a92011-12-31 20:10:15 +0000227 '6b894bae0411f6f21e76724047cc93e28a2b04176df31d0632b656e98ce9b6e8');
cristy3ed852e2009-09-05 21:47:34 +0000228
229print("CMYK format ...\n");
230++$test;
231testReadWriteSized( 'CMYK:input_70x46.cmyk',
232 'CMYK:output_70x46.cmyk',
233 '70x46',
234 8,
235 q//,
cristy11165b72011-09-28 17:26:49 +0000236 '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4');
cristy3ed852e2009-09-05 21:47:34 +0000237
238print("GRAY format ...\n");
239++$test;
240testReadWriteSized( 'GRAY:input_70x46.gray',
241 'GRAY:output_70x46.gray',
242 '70x46',
243 8,
244 q//,
cristy11165b72011-09-28 17:26:49 +0000245 'f28470f09857477a372a743665071cdc325613b963481d94b6dceabe292dd469' );
cristy3ed852e2009-09-05 21:47:34 +0000246
247print("RGB format ...\n");
248++$test;
249testReadWriteSized( 'RGB:input_70x46.rgb',
250 'RGB:output_70x46.rgb',
251 '70x46',
252 8,
253 q//,
cristy11165b72011-09-28 17:26:49 +0000254 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33' );
cristy3ed852e2009-09-05 21:47:34 +0000255
256
257print("RGBA format ...\n");
258++$test;
259testReadWriteSized( 'RGBA:input_70x46.rgba',
260 'RGBA:output_70x46.rgba',
261 '70x46',
262 8,
263 q//,
cristyd2cb5a92011-12-31 20:10:15 +0000264 'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3' );
cristy3ed852e2009-09-05 21:47:34 +0000265
2661;