blob: 1d8446683e38b8d47ca9bceff57fe4ee94192a50 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001#!/usr/bin/perl
Cristy93b707b2017-12-06 07:05:51 -05002# Copyright 1999-2018 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//,
Cristy0d8c21d2017-11-05 11:54:27 -050032 '646ac633d5b5553721e032d2c9f8f54ffc19d315832bbf808c2b7321b1067293');
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//,
cristyd0d85b42013-05-24 18:10:02 +000039 'e9b00f8a25976955cf8264391fc63f554396f4ac03d65cd0b1a2becbd667bc0b');
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//,
cristyd0d85b42013-05-24 18:10:02 +000046 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
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//,
cristyd0d85b42013-05-24 18:10:02 +000053 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
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//,
cristyd0d85b42013-05-24 18:10:02 +000060 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
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//,
cristyd0d85b42013-05-24 18:10:02 +000067 '74f6153fb577d01d852458d6e43d8fb639e203f6c9a6e55acce2ca8a493dfe35' );
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//,
cristy18139f02012-03-11 17:51:02 +000074 '4db1c9f8cf10c1a9a7e80397b4cf060d2d31caae13ba712712e6341fb96bd6b0',
cristyd0d85b42013-05-24 18:10:02 +000075 'e9b00f8a25976955cf8264391fc63f554396f4ac03d65cd0b1a2becbd667bc0b');
cristy3ed852e2009-09-05 21:47:34 +000076
77print("CompuServe graphics interchange format (1987) ...\n");
78++$test;
79testReadWrite( 'GIF87:input.gif87',
80 'GIF87:output.gif87',
81 q//,
cristy18139f02012-03-11 17:51:02 +000082 'a06fe5ec382d10ef6dce8d2bd729c4a57c66d82ed695e2786f1d1f280aaa17fb',
cristyd0d85b42013-05-24 18:10:02 +000083 '5c45e316eba35ac44cbe55c74b81259a1419f85264e5bb35b79db4a91bf0e3f1');
cristy3ed852e2009-09-05 21:47:34 +000084
85print("Magick image file format ...\n");
86++$test;
87testReadWrite( 'MIFF:input.miff',
88 'MIFF:output.miff',
89 q//,
cristyd0d85b42013-05-24 18:10:02 +000090 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +000091
92print("MTV Raytracing image format ...\n");
93++$test;
94testReadWrite( 'MTV:input.mtv',
95 'MTV:output.mtv',
96 q//,
cristyd0d85b42013-05-24 18:10:02 +000097 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +000098
99print("Portable bitmap format (black and white), ASCII format ...\n");
100++$test;
101testReadWrite( 'PBM:input_p1.pbm',
102 'PBM:output_p1.pbm',
103 q/compression=>'None'/,
cristyd0d85b42013-05-24 18:10:02 +0000104 'dedb5873a990158f0e5abdebda8c8dfb32de0be16b2b191fcb476b754e000a7b');
cristy3ed852e2009-09-05 21:47:34 +0000105
106print("Portable bitmap format (black and white), binary format ...\n");
107++$test;
108testReadWrite( 'PBM:input_p4.pbm',
109 'PBM:output_p4.pbm',
110 q//,
cristyd0d85b42013-05-24 18:10:02 +0000111 'dedb5873a990158f0e5abdebda8c8dfb32de0be16b2b191fcb476b754e000a7b');
cristy3ed852e2009-09-05 21:47:34 +0000112
113print("ZSoft IBM PC Paintbrush file ...\n");
114++$test;
115testReadWrite( 'PCX:input.pcx',
116 'PCX:output.pcx',
117 q//,
cristyd0d85b42013-05-24 18:10:02 +0000118 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +0000119
120print("Portable graymap format (gray scale), ASCII format ...\n");
121++$test;
122testReadWrite( 'PGM:input_p2.pgm',
123 'PGM:output_p2.pgm',
124 q/compression=>'None'/,
cristy097a7142013-06-23 18:15:38 +0000125 '63e162830260bb9892eb5a0e96301920e9cb4c6ed9016204dd58ededbb11923f');
cristy3ed852e2009-09-05 21:47:34 +0000126
127print("Apple Macintosh QuickDraw/PICT file ...\n");
128++$test;
129testReadWrite( 'PICT:input.pict',
130 'PICT:output.pict',
131 q//,
cristyd0d85b42013-05-24 18:10:02 +0000132 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +0000133
134print("Portable pixmap format (color), ASCII format ...\n");
135++$test;
136testReadWrite( 'PPM:input_p3.ppm',
137 'PPM:output_p3.ppm',
138 q/compression=>'None'/,
cristy097a7142013-06-23 18:15:38 +0000139 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +0000140
141print("Portable graymap format (gray scale), binary format ...\n");
142++$test;
143testReadWrite( 'PGM:input_p5.pgm',
144 'PGM:output_p5.pgm',
145 q//,
cristyd0d85b42013-05-24 18:10:02 +0000146 '63e162830260bb9892eb5a0e96301920e9cb4c6ed9016204dd58ededbb11923f');
cristy3ed852e2009-09-05 21:47:34 +0000147
148print("Portable pixmap format (color), binary format ...\n");
149++$test;
150testReadWrite( 'PPM:input_p6.ppm',
151 'PPM:output_p6.ppm',
152 q//,
cristyd0d85b42013-05-24 18:10:02 +0000153 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +0000154
155print("Adobe Photoshop bitmap file ...\n");
156++$test;
157testReadWrite( 'PSD:input.psd',
158 'PSD:output.psd',
159 q//,
cristyd0d85b42013-05-24 18:10:02 +0000160 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7' );
cristy3ed852e2009-09-05 21:47:34 +0000161
162print("Irix RGB image file ...\n");
163++$test;
164testReadWrite( 'SGI:input.sgi',
165 'SGI:output.sgi',
166 q//,
cristyd0d85b42013-05-24 18:10:02 +0000167 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +0000168
169print("SUN 1-bit Rasterfile ...\n");
170++$test;
171testReadWrite( 'SUN:input.im1',
172 'SUN:output.im1',
173 q//,
cristyd0d85b42013-05-24 18:10:02 +0000174 '678af4d3e2f78a1ef30cb1df2bd6f00b347082f5b3560257aacd9ac40fb47d63');
cristy3ed852e2009-09-05 21:47:34 +0000175
176print("SUN 8-bit Rasterfile ...\n");
177++$test;
178testReadWrite( 'SUN:input.im8',
179 'SUN:output.im8',
180 q//,
cristy18139f02012-03-11 17:51:02 +0000181 'a4c13fd97d6b9b32c016793d6ae2b01cee048b5f2790de8daaacccdf1c4b6956',
cristyd0d85b42013-05-24 18:10:02 +0000182 '8702000d509b897e48dc4834cf7fa1c2bf1a72ecc0d74a703e780f29b0835250');
cristy3ed852e2009-09-05 21:47:34 +0000183
184print("SUN True-Color Rasterfile ...\n");
185++$test;
186testReadWrite( 'SUN:input.im24',
187 'SUN:output.im24',
188 q//,
cristyd0d85b42013-05-24 18:10:02 +0000189 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +0000190
191print("Truevision Targa image file ...\n");
192++$test;
193testReadWrite( 'TGA:input.tga',
194 'TGA:output.tga',
195 q//,
cristyd0d85b42013-05-24 18:10:02 +0000196 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7');
cristy3ed852e2009-09-05 21:47:34 +0000197
198print("Khoros Visualization image file ...\n");
199++$test;
200testReadWrite( 'VIFF:input.viff',
201 'VIFF:output.viff',
202 q//,
cristy18139f02012-03-11 17:51:02 +0000203 'c211b4dd4e0c3b1d42a96682b0d290ae6bed5652670abe3c7fcca54503611b3c',
cristyd0d85b42013-05-24 18:10:02 +0000204 '43783afb71012dcc4860d856a171246019f555d402dad04f61a27e8db09ef58b');
cristy3ed852e2009-09-05 21:47:34 +0000205
206print("WBMP (Wireless Bitmap (level 0) image) ...\n");
207++$test;
208testReadWrite( 'WBMP:input.wbmp',
209 'WBMP:output.wbmp',
210 q//,
cristyd0d85b42013-05-24 18:10:02 +0000211 '49279b862c8528fd47023b65361c6fc7081677311893d6c80ce577d463a948d8');
cristy3ed852e2009-09-05 21:47:34 +0000212
213print("X Windows system bitmap (black and white only) ...\n");
214++$test;
215testReadWrite( 'XBM:input.xbm',
216 'XBM:output.xbm',
217 q//,
cristyd0d85b42013-05-24 18:10:02 +0000218 '38e65935f34b9814ce2c4d839ccd0438a3d8c2cfed93e6e0eb881787c28a91a4');
cristy3ed852e2009-09-05 21:47:34 +0000219
220print("X Windows system pixmap file (color) ...\n");
221++$test;
222testReadWrite( 'XPM:input.xpm',
223 'XPM:output.xpm',
224 q//,
cristy18139f02012-03-11 17:51:02 +0000225 'a4c13fd97d6b9b32c016793d6ae2b01cee048b5f2790de8daaacccdf1c4b6956',
cristyd0d85b42013-05-24 18:10:02 +0000226 '8702000d509b897e48dc4834cf7fa1c2bf1a72ecc0d74a703e780f29b0835250');
cristy3ed852e2009-09-05 21:47:34 +0000227
228print("CMYK format ...\n");
229++$test;
230testReadWriteSized( 'CMYK:input_70x46.cmyk',
231 'CMYK:output_70x46.cmyk',
232 '70x46',
233 8,
234 q//,
cristyd0d85b42013-05-24 18:10:02 +0000235 'f39e32b55a8ed4b2cc12c431cfe64fd0462f9aa0fb0122066f4010b562d5fe47');
cristy3ed852e2009-09-05 21:47:34 +0000236
237print("GRAY format ...\n");
238++$test;
239testReadWriteSized( 'GRAY:input_70x46.gray',
240 'GRAY:output_70x46.gray',
241 '70x46',
242 8,
243 q//,
cristyd0d85b42013-05-24 18:10:02 +0000244 '6e885bb6b3f0edd30266f9c59f453f93452dd551bf4b2618938a377b8c8d0b66' );
cristy3ed852e2009-09-05 21:47:34 +0000245
246print("RGB format ...\n");
247++$test;
248testReadWriteSized( 'RGB:input_70x46.rgb',
249 'RGB:output_70x46.rgb',
250 '70x46',
251 8,
252 q//,
cristyd0d85b42013-05-24 18:10:02 +0000253 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7' );
cristy3ed852e2009-09-05 21:47:34 +0000254
255
256print("RGBA format ...\n");
257++$test;
258testReadWriteSized( 'RGBA:input_70x46.rgba',
259 'RGBA:output_70x46.rgba',
260 '70x46',
261 8,
262 q//,
cristyd0d85b42013-05-24 18:10:02 +0000263 '646ac633d5b5553721e032d2c9f8f54ffc19d315832bbf808c2b7321b1067293' );
cristy3ed852e2009-09-05 21:47:34 +0000264
2651;