- updated the Thanks list in README
https://rt.cpan.org/Ticket/Display.html?id=71607
+ - check there's at least one coefficient for the convolution filter
+ https://rt.cpan.org/Ticket/Display.html?id=68993
+
Imager 0.85_01 - 10 Oct 2011
==============
mm_log((1,"i_conv(im %p, coeff %p, len %d)\n",im,coeff,len));
i_clear_error();
+
+ if (len < 1) {
+ i_push_error(0, "there must be at least one coefficient");
+ return 0;
+ }
center=(len-1)/2;
#!perl -w
use strict;
use Imager qw(:handy);
-use Test::More tests => 113;
+use Test::More tests => 116;
-d "testout" or mkdir "testout";
test($imbase, {type=>'conv', coef=>[ 0.3, 1, 0.3, ], },
'testout/t61_conv_blur.ppm');
+{
+ my $work = $imbase->copy;
+ ok(!Imager::i_conv($work->{IMG}, []), "conv should fail with empty array");
+ ok(!$work->filter(type => 'conv', coef => []),
+ "check the conv OO intergave too");
+ is($work->errstr, "there must be at least one coefficient",
+ "check conv error message");
+}
+
{
my $work8 = $imbase->copy;
ok(!$work8->filter(type => "conv", coef => "ABC"),