| #!/usr/bin/perl |
| # Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization |
| # dedicated to making software imaging solutions freely available. |
| # |
| # You may not use this file except in compliance with the License. You may |
| # obtain a copy of the License at |
| # |
| # http://www.imagemagick.org/script/license.php |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| # Test writing formats supported directly by ImageMagick |
| # |
| |
| BEGIN { $| = 1; $test=1; print "1..32\n"; } |
| END {print "not ok $test\n" unless $loaded;} |
| use Image::Magick; |
| $loaded=1; |
| |
| require 't/subroutines.pl'; |
| |
| chdir 't' || die 'Cd failed'; |
| |
| print("AVS X image file ...\n"); |
| testReadWrite( 'AVS:input.avs', |
| 'AVS:output.avs', |
| q//, |
| 'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3'); |
| |
| print("Microsoft Windows bitmap image file ...\n"); |
| ++$test; |
| testReadWrite( 'BMP:input.bmp', |
| 'BMP:output.bmp', |
| q//, |
| 'ae2007d0e05933a72294a6f8c7b59fc54d5fa3039f0f13bf8d65d05044ef2f39'); |
| |
| print("Microsoft Windows 24-bit bitmap image file ...\n"); |
| ++$test; |
| testReadWrite( 'BMP:input.bmp24', |
| 'BMP:output.bmp24', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("ZSoft IBM PC multi-page Paintbrush file ...\n"); |
| ++$test; |
| testReadWrite( 'DCX:input.dcx', |
| 'DCX:output.dcx', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Microsoft Windows 3.X DIB file ...\n"); |
| ++$test; |
| testReadWrite( 'DIB:input.dib', |
| 'DIB:output.dib', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Flexible Image Transport System ...\n"); |
| ++$test; |
| testReadWrite( 'FITS:input.fits', |
| 'FITS:output.fits', |
| q//, |
| 'f28470f09857477a372a743665071cdc325613b963481d94b6dceabe292dd469' ); |
| |
| print("CompuServe graphics interchange format ...\n"); |
| ++$test; |
| testReadWrite( 'GIF:input.gif', |
| 'GIF:output.gif', |
| q//, |
| 'ae2007d0e05933a72294a6f8c7b59fc54d5fa3039f0f13bf8d65d05044ef2f39'); |
| |
| print("CompuServe graphics interchange format (1987) ...\n"); |
| ++$test; |
| testReadWrite( 'GIF87:input.gif87', |
| 'GIF87:output.gif87', |
| q//, |
| 'a037bce490abf358b3c8e1f471a83d15434da26d6c91aa6d761407c0df573f1d'); |
| |
| print("Magick image file format ...\n"); |
| ++$test; |
| testReadWrite( 'MIFF:input.miff', |
| 'MIFF:output.miff', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("MTV Raytracing image format ...\n"); |
| ++$test; |
| testReadWrite( 'MTV:input.mtv', |
| 'MTV:output.mtv', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Portable bitmap format (black and white), ASCII format ...\n"); |
| ++$test; |
| testReadWrite( 'PBM:input_p1.pbm', |
| 'PBM:output_p1.pbm', |
| q/compression=>'None'/, |
| '57fc672e7e231d3f92793d9b2073132def273f4be3115bcbed1c49a1c3131222'); |
| |
| print("Portable bitmap format (black and white), binary format ...\n"); |
| ++$test; |
| testReadWrite( 'PBM:input_p4.pbm', |
| 'PBM:output_p4.pbm', |
| q//, |
| '57fc672e7e231d3f92793d9b2073132def273f4be3115bcbed1c49a1c3131222'); |
| |
| print("ZSoft IBM PC Paintbrush file ...\n"); |
| ++$test; |
| testReadWrite( 'PCX:input.pcx', |
| 'PCX:output.pcx', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Portable graymap format (gray scale), ASCII format ...\n"); |
| ++$test; |
| testReadWrite( 'PGM:input_p2.pgm', |
| 'PGM:output_p2.pgm', |
| q/compression=>'None'/, |
| 'e2e1b058a09c2b9c0c696996163911dcce325def773cb2a1554c6f21a0391ff7'); |
| |
| print("Apple Macintosh QuickDraw/PICT file ...\n"); |
| ++$test; |
| testReadWrite( 'PICT:input.pict', |
| 'PICT:output.pict', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Portable pixmap format (color), ASCII format ...\n"); |
| ++$test; |
| testReadWrite( 'PPM:input_p3.ppm', |
| 'PPM:output_p3.ppm', |
| q/compression=>'None'/, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Portable graymap format (gray scale), binary format ...\n"); |
| ++$test; |
| testReadWrite( 'PGM:input_p5.pgm', |
| 'PGM:output_p5.pgm', |
| q//, |
| 'e2e1b058a09c2b9c0c696996163911dcce325def773cb2a1554c6f21a0391ff7'); |
| |
| print("Portable pixmap format (color), binary format ...\n"); |
| ++$test; |
| testReadWrite( 'PPM:input_p6.ppm', |
| 'PPM:output_p6.ppm', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Adobe Photoshop bitmap file ...\n"); |
| ++$test; |
| testReadWrite( 'PSD:input.psd', |
| 'PSD:output.psd', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33' ); |
| |
| print("Irix RGB image file ...\n"); |
| ++$test; |
| testReadWrite( 'SGI:input.sgi', |
| 'SGI:output.sgi', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("SUN 1-bit Rasterfile ...\n"); |
| ++$test; |
| testReadWrite( 'SUN:input.im1', |
| 'SUN:output.im1', |
| q//, |
| 'cf6e645339d1bb82131ad658f2e7521f1e8aac69eb6e7add728f6157489972cd'); |
| |
| print("SUN 8-bit Rasterfile ...\n"); |
| ++$test; |
| testReadWrite( 'SUN:input.im8', |
| 'SUN:output.im8', |
| q//, |
| '6b894bae0411f6f21e76724047cc93e28a2b04176df31d0632b656e98ce9b6e8'); |
| |
| print("SUN True-Color Rasterfile ...\n"); |
| ++$test; |
| testReadWrite( 'SUN:input.im24', |
| 'SUN:output.im24', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33', |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33', |
| '5a5f94a626ee1945ab1d4d2a621aeec4982cccb94e4d68afe4c784abece91b3e'); |
| |
| print("Truevision Targa image file ...\n"); |
| ++$test; |
| testReadWrite( 'TGA:input.tga', |
| 'TGA:output.tga', |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); |
| |
| print("Khoros Visualization image file ...\n"); |
| ++$test; |
| testReadWrite( 'VIFF:input.viff', |
| 'VIFF:output.viff', |
| q//, |
| '7f2c98e7ce98983509580eaeb3bb6a420e3f358b39fcec4cdd96982ae1e21882', |
| 'bbeaa063bd13c74414a9962f21a795844661b596bd89f753f064ba1db2624d03', |
| 'aa4a6154f3c314d99c257280faf9097f3863a132ec8bddbc3b68209ce2c19487'); |
| |
| print("WBMP (Wireless Bitmap (level 0) image) ...\n"); |
| ++$test; |
| testReadWrite( 'WBMP:input.wbmp', |
| 'WBMP:output.wbmp', |
| q//, |
| 'b7b682361e82d9d7cf2bed34f76af87576b97590b12d76b961104e53ee18ee74', |
| '6d1374fa22aa5cb8fa9e98b928b8dea6e5fc6606ed2dc07c5f27d1e03e494d0e', |
| 'd818195f73f8d5db624c8f87a706bbcb3179dbb7a7f08abbad5b12cd97de8fe6'); |
| |
| print("X Windows system bitmap (black and white only) ...\n"); |
| ++$test; |
| testReadWrite( 'XBM:input.xbm', |
| 'XBM:output.xbm', |
| q//, |
| 'cf6e645339d1bb82131ad658f2e7521f1e8aac69eb6e7add728f6157489972cd'); |
| |
| print("X Windows system pixmap file (color) ...\n"); |
| ++$test; |
| testReadWrite( 'XPM:input.xpm', |
| 'XPM:output.xpm', |
| q//, |
| '6b894bae0411f6f21e76724047cc93e28a2b04176df31d0632b656e98ce9b6e8'); |
| |
| print("CMYK format ...\n"); |
| ++$test; |
| testReadWriteSized( 'CMYK:input_70x46.cmyk', |
| 'CMYK:output_70x46.cmyk', |
| '70x46', |
| 8, |
| q//, |
| '7e704fc1a99118630a92374ba27adf5baf69f30019016be2ed70eac79629e8b4'); |
| |
| print("GRAY format ...\n"); |
| ++$test; |
| testReadWriteSized( 'GRAY:input_70x46.gray', |
| 'GRAY:output_70x46.gray', |
| '70x46', |
| 8, |
| q//, |
| 'f28470f09857477a372a743665071cdc325613b963481d94b6dceabe292dd469' ); |
| |
| print("RGB format ...\n"); |
| ++$test; |
| testReadWriteSized( 'RGB:input_70x46.rgb', |
| 'RGB:output_70x46.rgb', |
| '70x46', |
| 8, |
| q//, |
| '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33' ); |
| |
| |
| print("RGBA format ...\n"); |
| ++$test; |
| testReadWriteSized( 'RGBA:input_70x46.rgba', |
| 'RGBA:output_70x46.rgba', |
| '70x46', |
| 8, |
| q//, |
| 'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3' ); |
| |
| 1; |