2 # Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization
3 # dedicated to making software imaging solutions freely available.
5 # You may not use this file except in compliance with the License. You may
6 # obtain a copy of the License at
8 # http://www.imagemagick.org/script/license.php
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.
16 # Test reading formats supported directly by ImageMagick.
18 BEGIN { $| = 1; $test=1; print "1..47\n"; }
19 END {print "not ok $test\n" unless $loaded;}
23 require 't/subroutines.pl';
25 chdir 't' || die 'Cd failed';
27 print("AVS X image file ...\n");
28 testReadCompare('input.avs', 'reference/read/input_avs.miff', q//, 0.0, 0.0);
30 print("Microsoft Windows bitmap image file ...\n");
32 testReadCompare('input.bmp', 'reference/read/input_bmp.miff', q//, 0.0, 0.0);
34 print("Microsoft Windows 24-bit bitmap image file ...\n");
36 testReadCompare('input.bmp24', 'reference/read/input_bmp24.miff', q//, 0.0, 0.0);
38 print("ZSoft IBM PC multi-page Paintbrush file ...\n");
40 testReadCompare('input.dcx', 'reference/read/input_dcx.miff', q//, 0.0, 0.0);
42 print("Microsoft Windows bitmap image file ...\n");
44 testReadCompare('input.dib', 'reference/read/input_dib.miff', q//, 0.0, 0.0);
46 print("Flexible Image Transport System ...\n");
48 testReadCompare('input.fits', 'reference/read/input_fits.miff', q//, 0.0, 0.0);
50 print("CompuServe graphics interchange format ...\n");
52 testReadCompare('input.gif', 'reference/read/input_gif.miff', q//, 0.02, 1.02);
54 print("CompuServe graphics interchange format (1987) ...\n");
56 testReadCompare('input.gif87', 'reference/read/input_gif87.miff', q//, 0.02, 1.02);
58 print("Gradient (gradual passing from one shade to another) ...\n");
60 testReadCompare('gradient:red-blue', 'reference/read/gradient.miff',
61 q/size=>"70x46"/, 0.2, 1.02);
63 print("GRANITE (granite texture) ...\n");
65 testReadCompare('granite:', 'reference/read/granite.miff', q/size=>"70x46"/, 0.0, 0.0);
67 print("MAT (MatLab gray 8-bit LSB integer) ...\n");
69 testReadCompare('input_gray_lsb_08bit.mat', 'reference/read/input_gray_lsb_08bit_mat.miff', q//, 0.2, 1.02);
71 print("MAT (MatLab gray 8-bit MSB integer) ...\n");
73 testReadCompare('input_gray_msb_08bit.mat', 'reference/read/input_gray_msb_08bit_mat.miff', q//, 0.0, 0.0);
75 print("MAT (MatLab gray 64-bit LSB double) ...\n");
77 testReadCompare('input_gray_lsb_double.mat', 'reference/read/input_gray_lsb_double_mat.miff', q//, 0.2, 1.02);
79 print("MAT (MatLab RGB 8-bit LSB integer) ...\n");
81 testReadCompare('input_rgb_lsb_08bit.mat', 'reference/read/input_rgb_lsb_08bit_mat.miff', q//, 0.2, 1.02);
83 print("Microsoft icon ...\n");
85 testReadCompare('input.ico', 'reference/read/input_ico.miff', q//, 0.0, 0.0);
87 print("Magick image file format ...\n");
89 testReadCompare('input.miff', 'reference/read/input_miff.miff', q//, 0.0, 0.0);
91 print("MTV Raytracing image format ...\n");
93 testReadCompare('input.mtv', 'reference/read/input_mtv.miff', q//, 0.0, 0.0);
95 print("NULL (white image) ...\n");
97 testReadCompare('NULL:white', 'reference/read/input_null_white.miff', q/size=>"70x46"/, 0.0, 0.0);
99 print("NULL (black image) ...\n");
101 testReadCompare('NULL:black', 'reference/read/input_null_black.miff', q/size=>"70x46"/, 0.0, 0.0);
103 print("NULL (DarkOrange image) ...\n");
105 testReadCompare('NULL:DarkOrange', 'reference/read/input_null_DarkOrange.miff', q/size=>"70x46"/, 0.0, 0.0);
107 print("Portable bitmap format (black and white), ASCII format ...\n");
109 testReadCompare('input_p1.pbm', 'reference/read/input_pbm_p1.miff', q//, 0.0, 0.0);
111 print("Portable bitmap format (black and white), binary format ...\n");
113 testReadCompare('input_p4.pbm', 'reference/read/input_pbm_p4.miff', q//, 0.0, 0.0);
115 print("ZSoft IBM PC Paintbrush file ...\n");
117 testReadCompare('input.pcx', 'reference/read/input_pcx.miff', q//, 0.0, 0.0);
119 print("Portable graymap format (gray scale), ASCII format ...\n");
121 testReadCompare('input_p2.pgm', 'reference/read/input_pgm_p2.miff', q//, 0.0, 0.0);
123 print("Portable graymap format (gray scale), binary format ...\n");
125 testReadCompare('input_p5.pgm', 'reference/read/input_pgm_p5.miff', q//, 0.0, 0.0);
127 print("Apple Macintosh QuickDraw/PICT file ...\n");
129 testReadCompare('input.pict', 'reference/read/input_pict.miff', q//, 0.0, 0.0);
131 print("Alias/Wavefront RLE image format ...\n");
133 testReadCompare('input.rle', 'reference/read/input_rle.miff', q//, 0.0, 0.0);
135 print("Portable pixmap format (color), ASCII format ...\n");
137 testReadCompare('input_p3.ppm', 'reference/read/input_ppm_p3.miff', q//, 0.0, 0.0);
139 print("Portable pixmap format (color), binary format ...\n");
141 testReadCompare('input_p6.ppm', 'reference/read/input_ppm_p6.miff', q//, 0.0, 0.0);
143 print("Adobe Photoshop bitmap file ...\n");
145 testReadCompare('input.psd', 'reference/read/input_psd.miff', q//, 0.0, 0.0);
147 print("Irix RGB image file ...\n");
149 testReadCompare('input.sgi', 'reference/read/input_sgi.miff', q//, 0.25, 1.1);
151 print("SUN 1-bit Rasterfile ...\n");
153 testReadCompare('input.im1', 'reference/read/input_im1.miff', q//, 0.0, 0.0);
155 print("SUN 8-bit Rasterfile ...\n");
157 testReadCompare('input.im8', 'reference/read/input_im8.miff', q//, 0.0, 0.0);
159 print("SUN TrueColor Rasterfile ...\n");
161 testReadCompare('sun:input.im24', 'reference/read/input_im24.miff', q//, 0.0, 0.0);
163 print("Truevision Targa image file ...\n");
165 testReadCompare('input.tga', 'reference/read/input_tga.miff', q//, 0.0, 0.0);
167 print("PSX TIM file ...\n");
169 testReadCompare('input.tim', 'reference/read/input_tim.miff', q//, 0.0, 0.0);
171 print("Khoros Visualization image file ...\n");
173 testReadCompare('input.viff', 'reference/read/input_viff.miff', q//, 0.0, 0.0);
175 print("WBMP (Wireless Bitmap (level 0) image) ...\n");
177 testReadCompare('input.wbmp', 'reference/read/input_wbmp.miff', q//, 0.0, 0.0);
179 print("X Windows system bitmap (black and white only) ...\n");
181 testReadCompare('input.xbm', 'reference/read/input_xbm.miff', q//, 0.0, 0.0);
183 print("XC: Constant image of X server color ...\n");
185 testReadCompare('xc:black', 'reference/read/input_xc_black.miff', q/size=>"70x46",, depth=>8/, 0.0, 0.0);
187 print("X Windows system pixmap file (color) ...\n");
189 testReadCompare('input.xpm', 'reference/read/input_xpm.miff', q//, 0.0, 0.0);
191 print("TILE (Tile image with a texture) ...\n");
192 # This is an internal generated format
193 # We will tile using the default image and a MIFF file
196 testReadCompare('TILE:input.miff', 'reference/read/input_tile.miff',
197 q/size=>"140x92", depth=>8/, 0.0, 0.0);
199 print("CMYK format ...\n");
201 testReadCompare('input_70x46.cmyk', 'reference/read/input_cmyk.miff',
202 q/size=>"70x46", depth=>8/, 0.0, 0.0);
204 print("GRAY format ...\n");
206 testReadCompare('input_70x46.gray', 'reference/read/input_gray.miff',
207 q/size=>"70x46", depth=>8/, 0.0, 0.0);
209 print("RGB format ...\n");
211 testReadCompare('input_70x46.rgb', 'reference/read/input_rgb.miff',
212 q/size=>"70x46", depth=>8/, 0.0, 0.0);
214 print("RGBA format ...\n");
216 testReadCompare('input_70x46.rgba', 'reference/read/input_rgba.miff',
217 q/size=>"70x46", depth=>8/, 0.0, 0.0);
219 print("UYVY format ...\n");
221 testReadCompare('input_70x46.uyvy', 'reference/read/input_uyvy.miff',
222 q/size=>"70x46", depth=>8/, 0.2, 1.02);