source: ImageMagick/branches/ImageMagick-6/PerlMagick/t/write.t @ 7891

Revision 7891, 7.4 KB checked in by cristy, 12 months ago (diff)
Line 
1#!/usr/bin/perl
2#  Copyright 1999-2012 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#    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//,
32  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
33
34print("Microsoft Windows bitmap image file ...\n");
35++$test;
36testReadWrite( 'BMP:input.bmp',
37  'BMP:output.bmp',
38  q//,
39  '5a25065144213cd0230b7572bd9aef0e447c23a0622193a94ae62c9895c44bf7');
40
41print("Microsoft Windows 24-bit bitmap image file ...\n");
42++$test;
43testReadWrite( 'BMP:input.bmp24',
44  'BMP:output.bmp24',
45  q//,
46  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
47
48
49print("ZSoft IBM PC multi-page Paintbrush file ...\n");
50++$test;
51testReadWrite( 'DCX:input.dcx',
52  'DCX:output.dcx',
53  q//,
54  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
55
56print("Microsoft Windows 3.X DIB file ...\n");
57++$test;
58testReadWrite( 'DIB:input.dib',
59  'DIB:output.dib',
60  q//,
61  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
62
63print("Flexible Image Transport System ...\n");
64++$test;
65testReadWrite( 'FITS:input.fits',
66  'FITS:output.fits',
67  q//,
68  '8365d1242126cb96856a9b4ade0bfad06900b4f42c3f05d589030c1240f37827' );
69
70print("CompuServe graphics interchange format ...\n");
71++$test;
72testReadWrite( 'GIF:input.gif',
73  'GIF:output.gif',
74  q//,
75  '5a25065144213cd0230b7572bd9aef0e447c23a0622193a94ae62c9895c44bf7');
76
77print("CompuServe graphics interchange format (1987) ...\n");
78++$test;
79testReadWrite( 'GIF87:input.gif87',
80  'GIF87:output.gif87',
81  q//,
82  '0138e1e5c9a7ed1604ec5bbe8c22378b84fcd9abb8c36e984b051f9efc14d54e');
83
84print("Magick image file format ...\n");
85++$test;
86testReadWrite( 'MIFF:input.miff',
87  'MIFF:output.miff',
88  q//,
89  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
90
91print("MTV Raytracing image format ...\n");
92++$test;
93testReadWrite( 'MTV:input.mtv',
94  'MTV:output.mtv',
95  q//,
96  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
97
98print("Portable bitmap format (black and white), ASCII format ...\n");
99++$test;
100testReadWrite( 'PBM:input_p1.pbm',
101  'PBM:output_p1.pbm',
102  q/compression=>'None'/,
103  '83175f7bcc43fb71212dee254c85e355c18bcd25f35d3b9caba66fff7341fa64');
104
105print("Portable bitmap format (black and white), binary format ...\n");
106++$test;
107testReadWrite( 'PBM:input_p4.pbm',
108  'PBM:output_p4.pbm',
109  q//,
110  '83175f7bcc43fb71212dee254c85e355c18bcd25f35d3b9caba66fff7341fa64');
111
112print("ZSoft IBM PC Paintbrush file ...\n");
113++$test;
114testReadWrite( 'PCX:input.pcx',
115  'PCX:output.pcx',
116  q//,
117  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
118
119print("Portable graymap format (gray scale), ASCII format ...\n");
120++$test;
121testReadWrite( 'PGM:input_p2.pgm',
122  'PGM:output_p2.pgm',
123  q/compression=>'None'/,
124  '39bfd79b101f69842dfd0ee9dec46569147a22dc1557b84fadb60adb5b873f37');
125
126print("Apple Macintosh QuickDraw/PICT file ...\n");
127++$test;
128testReadWrite( 'PICT:input.pict',
129  'PICT:output.pict',
130  q//,
131  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
132
133print("Portable pixmap format (color), ASCII format ...\n");
134++$test;
135testReadWrite( 'PPM:input_p3.ppm',
136  'PPM:output_p3.ppm',
137  q/compression=>'None'/,
138  '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33');
139
140print("Portable graymap format (gray scale), binary format ...\n");
141++$test;
142testReadWrite( 'PGM:input_p5.pgm',
143  'PGM:output_p5.pgm',
144  q//,
145  '39bfd79b101f69842dfd0ee9dec46569147a22dc1557b84fadb60adb5b873f37');
146
147print("Portable pixmap format (color), binary format ...\n");
148++$test;
149testReadWrite( 'PPM:input_p6.ppm',
150  'PPM:output_p6.ppm',
151  q//,
152  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
153
154print("Adobe Photoshop bitmap file ...\n");
155++$test;
156testReadWrite( 'PSD:input.psd',
157  'PSD:output.psd',
158  q//,
159  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7' );
160
161print("Irix RGB image file ...\n");
162++$test;
163testReadWrite( 'SGI:input.sgi',
164  'SGI:output.sgi',
165  q//,
166  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
167
168print("SUN 1-bit Rasterfile ...\n");
169++$test;
170testReadWrite( 'SUN:input.im1',
171  'SUN:output.im1',
172  q//,
173  '8922c9505ece06295a015d23e28da3727c3bc7ab22593f98e0fc8784aa16d0c2');
174
175print("SUN 8-bit Rasterfile ...\n");
176++$test;
177testReadWrite( 'SUN:input.im8',
178  'SUN:output.im8',
179  q//,
180  'd28c7104a30c8986c34b98a4209de5d4b8a79911a9b5c46037e62c8a2063a09c');
181
182print("SUN True-Color Rasterfile ...\n");
183++$test;
184testReadWrite( 'SUN:input.im24',
185  'SUN:output.im24',
186  q//,
187  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7',
188  'c44fd9695c066798a9dc010010cdff2921b95b67753164f3179352bafee98d10',
189  '5a5f94a626ee1945ab1d4d2a621aeec4982cccb94e4d68afe4c784abece91b3e');
190
191print("Truevision Targa image file ...\n");
192++$test;
193testReadWrite( 'TGA:input.tga',
194  'TGA:output.tga',
195  q//,
196  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
197
198print("Khoros Visualization image file ...\n");
199++$test;
200testReadWrite( 'VIFF:input.viff',
201  'VIFF:output.viff',
202  q//,
203  '7f2c98e7ce98983509580eaeb3bb6a420e3f358b39fcec4cdd96982ae1e21882',
204  'ede99c6be1a9d82cd2f37b87dfd7cd5369391ff42b566ff1d5491f58e60637cb',
205  'aa4a6154f3c314d99c257280faf9097f3863a132ec8bddbc3b68209ce2c19487');
206
207print("WBMP (Wireless Bitmap (level 0) image) ...\n");
208++$test;
209testReadWrite( 'WBMP:input.wbmp',
210  'WBMP:output.wbmp',
211  q//,
212  'b7b682361e82d9d7cf2bed34f76af87576b97590b12d76b961104e53ee18ee74',
213  '1a3a1f20e9126794a0347d4920c497b5b203767d1a507db728901dc66874ea0d',
214  'd818195f73f8d5db624c8f87a706bbcb3179dbb7a7f08abbad5b12cd97de8fe6');
215
216print("X Windows system bitmap (black and white only) ...\n");
217++$test;
218testReadWrite( 'XBM:input.xbm',
219  'XBM:output.xbm',
220  q//,
221  '4cc91a24ddcbe4a9563b1ca063f765ec1ca4514cc3e3ba3e710f1226e49a8dd5');
222
223print("X Windows system pixmap file (color) ...\n");
224++$test;
225testReadWrite( 'XPM:input.xpm',
226  'XPM:output.xpm',
227  q//,
228  'fa51c37680393251b7011d1825df7a5ed4e0f78168afb4d6d5c59aa4d45ade12');
229
230print("CMYK format ...\n");
231++$test;
232testReadWriteSized( 'CMYK:input_70x46.cmyk',
233  'CMYK:output_70x46.cmyk',
234  '70x46',
235  8,
236  q//,
237  '1d9a2a8b39e8fc584ce24166e4e8a1544a5302b90fd84ff069d0d01c525f3462');
238
239print("GRAY format ...\n");
240++$test;
241testReadWriteSized( 'GRAY:input_70x46.gray',
242  'GRAY:output_70x46.gray',
243  '70x46',
244  8,
245  q//,
246  '8365d1242126cb96856a9b4ade0bfad06900b4f42c3f05d589030c1240f37827' );
247
248print("RGB format ...\n");
249++$test;
250testReadWriteSized( 'RGB:input_70x46.rgb',
251  'RGB:output_70x46.rgb',
252  '70x46',
253  8,
254  q//,
255  'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7' );
256
257
258print("RGBA format ...\n");
259++$test;
260testReadWriteSized( 'RGBA:input_70x46.rgba',
261  'RGBA:output_70x46.rgba',
262  '70x46',
263  8,
264  q//,
265  '1252b2f3facc0fb67fcfacfc01938843566acbb9480bbe077a4c6f6af528eb4e' );
266
2671;
Note: See TracBrowser for help on using the repository browser.