- i_img_pal_new() now releases the image object memory if creation
fails.
- set i_format to gif when reading gif files and test for it
+- set i_format to pnm when reading pnm files and test for it
=================================================================
im = i_img_empty_ch(NULL, width, height, channels);
+ i_tags_add(&im->tags, "i_format", 0, "pnm", -1, 0);
+
switch (type) {
case 1: /* Ascii types */
case 2:
#!perl -w
use Imager ':all';
-require "t/testtools.pl";
+BEGIN { require "t/testtools.pl"; }
use strict;
-print "1..43\n";
+print "1..45\n";
init_log("testout/t104ppm.log",1);
check_color(43, $green, 127, 127, 0, "green 4095 pixel");
}
+my $num = 44;
+{ # check i_format is set when reading a pnm file
+ # doesn't really matter which file.
+ my $maxval = Imager->new;
+ okn($num++, $maxval->read(file=>"testimg/maxval.ppm"),
+ "read test file");
+ my ($type) = $maxval->tags(name=>'i_format');
+ isn($num++, $type, 'pnm', "check i_format");
+}
+
sub openimage {
my $fname = shift;
local(*FH);