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
+- set i_format to tga when reading tga files and test for it
+- handle image creation failures when reading tga files
=================================================================
#!perl -w
-print "1..16\n";
+print "1..17\n";
use Imager qw(:all);
use strict;
+BEGIN { require "t/testtools.pl"; }
init_log("testout/t108tga.log",1);
print "not ok 16 # ",$imoo->errstr,"\n";
}
-
+my ($type) = $imoo->tags(name=>'i_format');
+isn(17, $type, 'tga', "check i_format tag");
sub write_test {
img = mapped ?
i_img_pal_new(width, height, channels, 256) :
i_img_empty_ch(NULL, width, height, channels);
+
+ if (!img) {
+ if (idstring)
+ myfree(idstring);
+ return NULL;
+ }
if (idstring) {
i_tags_add(&img->tags, "tga_idstring", 0, idstring, header.idlength, 0);
myfree(databuf);
if (linebuf) myfree(linebuf);
+ i_tags_add(&img->tags, "i_format", 0, "tga", -1, 0);
i_tags_addn(&img->tags, "tga_bitspp", 0, mapped?header.colourmapdepth:header.bitsperpixel);
if (src.compressed) i_tags_addn(&img->tags, "compressed", 0, 1);
return img;