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 blobs supported directly by ImageMagick.
18 BEGIN { $| = 1; $test=1; print "1..2\n"; }
19 END {print "not ok $test\n" unless $loaded;}
23 require 't/subroutines.pl';
25 chdir 't' || die 'Cd failed';
27 my (@blob, $filename, $format, $height, $image, $size, $status, $width);
29 $filename='input_p6.ppm';
30 print "Ping \"$filename\" ...\n";
31 $image=Image::Magick->new;
32 ($width, $height, $size, $format)=$image->Ping("$filename");
33 if (($width == 70) && ($height == 46) && ($size == 9673) && ($format eq "PNM"))
39 print "not ok $test\n";
44 print("Ping blob ...\n");
45 $image=Image::Magick->new;
46 $status=$image->Read($filename);
47 warn "$status" if "$status";
48 @blob=$image->ImageToBlob();
50 $image=Image::Magick->new;
51 ($width, $height, $size, $format)=$image->Ping(blob=>@blob);
54 if (($width == 70) && ($height == 46) && ($size == 9673) && ($format eq "PNM"))
60 print "not ok $test\n";