<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi again,<br><br>you have to apply the filter for the edges to become transparent.<br><br><hr id="stopSpelling">Date: Mon, 3 May 2010 10:28:06 +0400<br>Subject: Gaussian filter bounds problems<br>From: dimula73@gmail.com<br>To: schumifer@hotmail.com<br>CC: kimageshop@kde.org<br><br>Hi, Edward!<br><br>I tried to reproduce the bug with png image bounds today and i failed. Everything seems to work with Blur and Gaussian Blur filters added as masks and adjustment layers. Could you describe  how to reproduce it here?<br>
<br><br>Btw, i found a bug in Gaussian Blur filter. Try to apply it to an image that is bigger than 512x512 pixels. You get a border effect.<br>The cause is this code, i think:<br><span style="font-family: courier new,monospace;">&nbsp;if ( (horizontalRadius &gt; 0) &amp;&amp; (verticalRadius &gt; 0) )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisPaintDeviceSP interm = new KisPaintDevice(src-&gt;colorSpace());</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionKernelSP kernelHoriz = KisConvolutionKernel::fromMatrix(horizGaussian, 0, horizGaussian.sum());</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionKernelSP kernelVertical = KisConvolutionKernel::fromMatrix(verticalGaussian, 0, verticalGaussian.sum());</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionPainter horizPainter(interm, dstInfo.selection());</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; horizPainter.setChannelFlags(channelFlags);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; horizPainter.setProgress(progressUpdater);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; horizPainter.applyMatrix(kernelHoriz, src, srcTopLeft, srcTopLeft, size, BORDER_REPEAT);</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; KisConvolutionPainter verticalPainter(dst, dstInfo.selection());</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verticalPainter.setChannelFlags(channelFlags);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verticalPainter.setProgress(progressUpdater);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verticalPainter.applyMatrix(kernelVertical, interm, srcTopLeft, dstTopLeft, size, BORDER_REPEAT);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; }<br><br>The problem is, when you convolve the second time, there is no needRect prepared for the convolution. src device has this additional data (it is prepared by walkers), while interm doesn't. I see the only way out in bitBlt'ing src into interm, but this will be very inefficient. Or writing a special RepeatIteratorFactory that might be too complex task...<br>
<br><br style="font-family: courier new,monospace;" clear="all"></span><br>-- <br>Dmitry Kazakov<br>                                               <br /><hr />Hotmail: Powerful Free email with security by Microsoft. <a href='https://signup.live.com/signup.aspx?id=60969' target='_new'>Get it now.</a></body>
</html>