- other internal image representations (design/represent.txt)
+ - Error handling, make a general i_errstr object and arrange
+ such that each image has an i_errstr object to hold its
+ local errors?
+
Good stuff:
- image colour transformations based on input images, see
- design/cmyktorgb.txt for Addi's description
+ design/cmyktorgb.txt for Addi's description
- eventually support tiff's madness
Old sins:
- Add mycalloc() and myrealloc() to the malloc() wrappers.
- should i_readgif returned colormap be an arrayref of
- Imager::Color objects? Note that this will break
- compatibility with previous releases.
+ Imager::Color objects? Note that this will break
+ compatibility with previous releases.
- should Imager::Font be split into a base class whose
new chooses a base class (ttf, t1 or win32?) to
print "ok 1 # skip no jpeg support\n";
print "ok 2 # skip no jpeg support\n";
} else {
- open(FH,">testout/t11.jpg") || die "cannot open testout/t11.jpg for writing\n";
+ open(FH,">testout/t101.jpg") || die "cannot open testout/t101.jpg for writing\n";
binmode(FH);
i_writejpeg($img,fileno(FH),30);
close(FH);
print "ok 1\n";
- open(FH,"testout/t11.jpg") || die "cannot open testout/t11.jpg\n";
+ open(FH,"testout/t101.jpg") || die "cannot open testout/t101.jpg\n";
binmode(FH);
($cmpimg,undef)=i_readjpeg(fileno(FH));
print "1..4\n";
use Imager qw(:all);
-init_log("testout/t105gif.log",1);
+init_log("testout/t106tiff.log",1);
$green=i_color_new(0,255,0,255);
$blue=i_color_new(0,0,255,255);
print "ok 2 # skip no tiff support\n";
print "ok 3 # skip no tiff support\n";
} else {
- open(FH,">testout/t10.tiff") || die "cannot open testout/t10.tiff for writing\n";
+ open(FH,">testout/t106.tiff") || die "cannot open testout/t10.tiff for writing\n";
binmode(FH);
my $IO = Imager::io_new_fd(fileno(FH));
i_writetiff_wiol($img, $IO);
print "ok 1\n";
- open(FH,"testout/t10.tiff") or die "cannot open testout/t10.tiff\n";
+ open(FH,"testout/t106.tiff") or die "cannot open testout/t106.tiff\n";
binmode(FH);
$IO = Imager::io_new_fd(fileno(FH));
$cmpimg = i_readtiff_wiol($IO, -1);
Imager::i_writetiff_wiol($img, $IO) or die "Cannot write to bufferchain\n";
my $tiffdata = Imager::io_slurp($IO);
- open(FH,"testout/t10.tiff");
+ open(FH,"testout/t106.tiff");
my $odata;
{ local $/;
$odata = <FH>;
BEGIN { $| = 1; print "1..2\n"; }
END {print "not ok 1\n" unless $loaded;}
use Imager;
-#use Data::Dumper;
+
$loaded = 1;
print "ok 1\n";
-init_log("testout/t00basicoo.log",1);
-
-#list_formats();
+Imager::init(log=>"testout/t50basicoo.log");
%hsh=%Imager::formats;
$img = Imager->new();
-@all=qw(tiff gif jpg png ppm raw);
-
-for(@all) {
- if (!$hsh{$_}) { next; }
- print "#opening Format: $_\n";
- if ($_ eq "raw") {
- $img->read(file=>"testout/t10.$_",type=>'raw', xsize=>150,ysize=>150) or die "failed: ",$img->{ERRSTR},"\n";
- } else {
- $img->read(file=>"testout/t10.$_") or die "failed: ",$img->{ERRSTR},"\n";
- }
+@types = qw( jpeg png raw ppm gif tiff );
+
+@files{@types} = ({ file => "testout/t101.jpg" },
+ { file => "testout/t102.png" },
+ { file => "testout/t103.raw", xsize=>150, ysize=>150, type=>"raw" },
+ { file => "testout/t104.ppm" },
+ { file => "testout/t105.gif" },
+ { file => "testout/t106.tiff" });
+
+for $type (@types) {
+ next unless $hsh{$type};
+ my %opts = %{$files{$type}};
+ my @a = map { "$_=>${opts{$_}}" } keys %opts;
+ print "#opening Format: $type, options: @a\n";
+ $img->read( %opts ) or die "failed: ",$img->errstr,"\n";
}
-$img2=$img->crop(width=>50,height=>50);
-$img2->write(file=>'testout/t50.ppm',type=>'pnm');
+$img2=$img->crop(width=>50, height=>50);
+$img2->write(file=> 'testout/t50.ppm', type=>'pnm');
undef($img);
-malloc_state();
-
+Imager::malloc_state();
print "ok 2\n";
$img=Imager->new() || die "unable to create image object\n";
-$img->open(file=>'testout/t10.ppm',type=>'pnm') || die "failed: ",$img->{ERRSTR},"\n";
+$img->open(file=>'testout/t104.ppm',type=>'pnm') || die "failed: ",$img->{ERRSTR},"\n";
$plug='dynfilt/dyntest.'.$Config{'so'};
load_plugin($plug) || die "unable to load plugin:\n$Imager::ERRSTR\n";