1 # Before `make install' is performed this script should be runnable with
2 # `make test'. After `make install' it should work as `perl test.pl'
4 ######################### We start with some black magic to print on failure.
6 # Change 1..1 below to 1..last_test_to_print .
7 # (It may become useful if the test is moved to ./t subdirectory.)
9 BEGIN { $| = 1; print "1..2\n"; }
10 END {print "not ok 1\n" unless $loaded;}
17 Imager::init(log=>"testout/t50basicoo.log");
19 %hsh=%Imager::formats;
21 print "# avaliable formats:\n";
22 for(keys %hsh) { print "# $_\n"; }
28 @types = qw( jpeg png raw ppm gif tiff );
30 @files{@types} = ({ file => "testout/t101.jpg" },
31 { file => "testout/t102.png" },
32 { file => "testout/t103.raw", xsize=>150, ysize=>150, type=>"raw" },
33 { file => "testout/t104.ppm" },
34 { file => "testout/t105.gif" },
35 { file => "testout/t106.tiff" });
38 next unless $hsh{$type};
39 my %opts = %{$files{$type}};
40 my @a = map { "$_=>${opts{$_}}" } keys %opts;
41 print "#opening Format: $type, options: @a\n";
42 $img->read( %opts ) or die "failed: ",$img->errstr,"\n";
45 $img2=$img->crop(width=>50, height=>50);
46 $img2->write(file=> 'testout/t50.ppm', type=>'pnm');
50 Imager::malloc_state();