Sat Aug 17 01:04:02 2019: Request 130322 was acted upon. Transaction: Ticket created by user42_ke...@yahoo.com.au Queue: Wx Subject: Wx::Image bad bytes saving by Wx::BMPHandler SaveFile Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: user42_ke...@yahoo.com.au Status: new Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=130322 >
In recent Debian i386 WxPerl 0.9932 and Wx library 3.0.4, saving a Wx::Image using Wx::BMPHandler seems to give bad bytes in the output. The program below gives a good file by the Wx::Image SaveFile method, but different and apparently bad file by the Wx::BMPHandler method. I hope I've made a correct call for the handler SaveFile. I believe this or something like it worked in the past. Dunno if it's a WxPerl problem or a Wx problem. Saving to PNG and JPEG seem ok. I struck this on CUR format (variant of BMP) which is bad too. A hex dump shows the good one 00000 42 4D 8E 02 00 00 00 00-00 00 36 00 00 00 28 00 BM........6...(. ... and the bad one 00000 42 4D 4D 8E 02 00 00 02-00 00 00 00 00 00 00 00 BMM............. 00010 00 00 00 00 00 00 00 36-00 00 00 00 00 00 00 00 .......6........ 00020 00 28 00 00 00 00 00 00-00 00 00 14 00 00 00 00 .(.............. ... The bad looks worryingly like it's got extra 00 bytes in between the intended ones (though I've no explanation for why 4D is duplicated). Could it be any wide char vs byte coding ? use strict; use Wx; my $image = Wx::Image->new(20,10); $image->SaveFile('/tmp/save-by-image.bmp', Wx::wxBITMAP_TYPE_BMP()); my $handler = Wx::BMPHandler->new; open my $fh, '>', '/tmp/save-by-handler.bmp' or die $!; $handler->SaveFile($image, $fh); close $fh or die $!; system "ls -l /tmp/save-by-image.bmp /tmp/save-by-handler.bmp";