- added information on reporting bugs to the SUPPORT section of Imager.pm
- regops.perl now sorts the dumped data structure to produce minimal diffs
- quant.c now checks for integer overflow allocating its image data
+- i_readraw_wiol() now checks for image creation failure
+- i_readrgb_wiol() now checks for image creation failure
+- i_writergb_wiol() was an empty stub, it now pushes an error message
+ and explicitly returns failure.
+- i_readrgb_wiol() now sets i_format to rgb.
+- set i_format to raw when reading tga files and test for it
+- document i_format tag
=================================================================
If this tag is present then the whole image could not be read. This
isn't implemented for all images yet.
-=back
-
-
+=item i_format
+The file format this file was read from.
+=back
=head2 Quantization options
ig, x, y, datachannels, storechannels, intrl));
im = i_img_empty_ch(NULL,x,y,storechannels);
+ if (!im)
+ return NULL;
inbuflen = im->xsize*datachannels;
ilbuflen = inbuflen;
myfree(inbuffer);
if (intrl != 0) myfree(ilbuffer);
if (datachannels != storechannels) myfree(exbuffer);
+
+ i_tags_add(&im->tags, "i_format", 0, "raw", -1, 0);
+
return im;
}
channels = header.zsize;
img = i_img_empty_ch(NULL, width, height, channels);
+ if (!img)
+ return NULL;
i_tags_add(&img->tags, "rgb_namestr", 0, header.name, 80, 0);
-
+ i_tags_add(&img->tags, "i_format", 0, "rgb", -1, 0);
switch (header.storagetype) {
case 0: /* uncompressed */
break;
}
+ i_tags_add(&img->tags, "i_format", 0, "rgb", -1, 0);
+
i_mempool_destroy(&mp);
return img;
undef_int
i_writergb_wiol(i_img *img, io_glue *ig, int wierdpack, int compress, char *idstring, size_t idlen) {
-
-
-
+ i_clear_error();
+ i_push_error(0, "writing SGI RGB files is not implemented");
+ return 0;
}
#!perl -w
-print "1..15\n";
+print "1..16\n";
use Imager qw(:all);
use strict;
init_log("testout/t103raw.log",1);
$diff and print "not ";
print "ok 15\n";
+# check that i_format is set correctly
+my $index = Imager::i_tags_find($cmpimgmask, 'i_format', 0);
+
+if ($index) {
+ my $value = Imager::i_tags_get($cmpimgmask, $index);
+ print $value eq 'raw' ? "ok 16\n" : "not ok 16 - bad value for i_format tag\n";
+}
+else {
+ print "not ok 16 - no i_format tag set\n";
+}
+
sub read_test {
my ($in, $xsize, $ysize, $data, $store, $intrl, $base, $test) = @_;
open FH, $in or die "Cannot open $in: $!";