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