13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#!/usr/bin/perl
27ce65e7125a4e1df1a274ce373c537a9df9c16cdCristy#  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  dedicated to making software imaging solutions freely available.
43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#
53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  You may not use this file except in compliance with the License.  You may
63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  obtain a copy of the License at
73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#
83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#    http://www.imagemagick.org/script/license.php
93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#
103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  Unless required by applicable law or agreed to in writing, software
113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  distributed under the License is distributed on an "AS IS" BASIS,
123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  See the License for the specific language governing permissions and
143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#  limitations under the License.
153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#
163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy# Test image blobs.
173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#
183ed852eea50f9d4cd633efb8c2b054b8e33c253cristyBEGIN { $| = 1; $test=1, print "1..1\n"; }
193ed852eea50f9d4cd633efb8c2b054b8e33c253cristyEND {print "not ok 1\n" unless $loaded;}
203ed852eea50f9d4cd633efb8c2b054b8e33c253cristyuse Image::Magick;
213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$loaded=1;
223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
233ed852eea50f9d4cd633efb8c2b054b8e33c253cristychdir 't' || die 'Cd failed';
243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image = new Image::Magick;
263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image->Read( 'input.miff' );
273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy@blob = $image->ImageToBlob();
283ed852eea50f9d4cd633efb8c2b054b8e33c253cristyundef $image;
293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image=Image::Magick->new( magick=>'MIFF' );
313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image->BlobToImage( @blob );
323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
333ed852eea50f9d4cd633efb8c2b054b8e33c253cristyif ($image->Get('signature') ne 
344e285b94d1d76a33063a0036178938f6f5239da3cristy    'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7')
353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  { print "not ok $test\n"; }
363ed852eea50f9d4cd633efb8c2b054b8e33c253cristyelse
373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  { print "ok $test\n"; }
383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy1;
40