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