tests for it.
http://rt.cpan.org/Ticket/Display.html?id=41028
+ - write out the image size in bytes field of a BMP correctly.
+ http://rt.cpan.org/Ticket/Display.html?id=41406
+
Imager 0.66 - 22 April 2008
===========
if (!write_packed(ig, "CCVvvVVVVvvVVVVVV", 'B', 'M', data_size+offset,
0, 0, offset, INFOHEAD_SIZE, im->xsize, im->ysize, 1,
- bit_count, BI_RGB, 0, (int)(xres+0.5), (int)(yres+0.5),
+ bit_count, BI_RGB, data_size, (int)(xres+0.5), (int)(yres+0.5),
colors_used, colors_used)){
i_push_error(0, "cannot write bmp header");
return 0;
#!perl -w
use strict;
-use Test::More tests => 211;
+use Test::More tests => 213;
use Imager qw(:all);
-use Imager::Test qw(test_image_raw is_image is_color3);
+use Imager::Test qw(test_image_raw is_image is_color3 test_image);
init_log("testout/t107bmp.log",1);
my $debug_writes = 0;
"check translucent came through");
}
+{ # RT 41406
+ my $data;
+ my $im = test_image();
+ ok($im->write(data => \$data, type => 'bmp'), "write using OO");
+ my $size = unpack("V", substr($data, 34, 4));
+ is($size, 67800, "check data size");
+}
+
sub write_test {
my ($im, $filename) = @_;
local *FH;