Fellow monks:
I'm trying the following thing with Image::Magick. As you can see, it's all very simple, but it segfaults when trying to write the image in wbmp format..
Does anyone have any clues?
#!/usr/bin/perl
use Image::Magick ;
my @files = grep { /png/ } `ls` ;
foreach my $f (@files) {
chomp $f ;
my $loc = Image::Magick->new;
$loc->Read($f);
$loc->Set(monochrome => "True") ;
$loc->Set(monochrome => "True",matte =>"True") ;
my ($w, $h, $size, $format) = $loc->Ping("$f");
$w = 1+int(($w-1)/8);
$w *= 8;
my $bg = Image::Magick->new;
$bg->Set(debug =>"All") ;
$bg->Set(size=>$w."x$h");
# $bg->Set(type => "Grayscale") ;
$bg->Set(monochrome => "True") ;
$bg->ReadImage('xc:white');
$bg->Composite(image=>$loc, gravity=>"Center");
undef $loc;
$bg->Set(monochrome => "True",matte =>"True") ;
$bg->Write("wbmp:foo.wbmp") ;
last;
}