]> git.imager.perl.org - imager.git/blob - t/t50basicoo.t
make filenames match test number
[imager.git] / t / t50basicoo.t
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'
3
4 ######################### We start with some black magic to print on failure.
5
6 # Change 1..1 below to 1..last_test_to_print .
7 # (It may become useful if the test is moved to ./t subdirectory.)
8
9 BEGIN { $| = 1; print "1..2\n"; }
10 END {print "not ok 1\n" unless $loaded;}
11 use Imager;
12 #use Data::Dumper;
13 $loaded = 1;
14
15 print "ok 1\n";
16
17 init_log("testout/t00basicoo.log",1);
18
19 #list_formats();
20
21 %hsh=%Imager::formats;
22
23 print "# avaliable formats:\n";
24 for(keys %hsh) { print "# $_\n"; }
25
26 #print Dumper(\%hsh);
27
28 $img = Imager->new();
29
30 @all=qw(tiff gif jpg png ppm raw);
31
32 for(@all) {
33   if (!$hsh{$_}) { next; }
34   print "#opening Format: $_\n";
35   if ($_ eq "raw") {
36     $img->read(file=>"testout/t10.$_",type=>'raw', xsize=>150,ysize=>150) or die "failed: ",$img->{ERRSTR},"\n";
37   } else {
38     $img->read(file=>"testout/t10.$_") or die "failed: ",$img->{ERRSTR},"\n";
39   }
40 }
41
42 $img2=$img->crop(width=>50,height=>50);
43 $img2->write(file=>'testout/t50.ppm',type=>'pnm');
44
45 undef($img);
46
47 malloc_state();
48
49
50 print "ok 2\n";