- add tests for each type of iolayer in t50basicoo.t
- read/write multi-image tiff files
- tests in t50basicoo.t for multi-image/file
+ - ASCII PBM files were reading white as dark gray (255 vs 1)
=================================================================
for(y=0;y<height;y++) for(x=0; x<width; x++) {
for(ch=0; ch<channels; ch++) {
int t;
- if (gnum(&buf, &t)) val.channel[ch] = t;
+ if (gnum(&buf, &t)) val.channel[ch] = t * mult;
else {
mm_log((1,"i_readpnm: gnum() returned false in data\n"));
return im;
use Imager ':all';
-print "1..8\n";
+print "1..13\n";
init_log("testout/t104ppm.log",1);
i_img_diff($gimg, $gcmpimg) == 0 or print "not ";
print "ok 8\n";
+my $ooim = Imager->new;
+$ooim->read(file=>"testimg/simple.pbm") or print "not ";
+print "ok 9\n";
+
+check_gray(10, Imager::i_get_pixel($ooim->{IMG}, 0, 0), 255);
+check_gray(11, Imager::i_get_pixel($ooim->{IMG}, 0, 1), 0);
+check_gray(12, Imager::i_get_pixel($ooim->{IMG}, 1, 0), 0);
+check_gray(13, Imager::i_get_pixel($ooim->{IMG}, 1, 1), 255);
+
sub openimage {
my $fname = shift;
local(*FH);
close($fh);
return $data;
}
+
+sub check_gray {
+ my ($num, $c, $gray) = @_;
+
+ my ($g) = $c->rgba;
+ if ($g == $gray) {
+ print "ok $num\n";
+ }
+ else {
+ print "not ok $num # $g doesn't match $gray\n";
+ }
+}