Bug 1477 : filter(DILATE/ERODE) - dilate(boolean) has bug in clamping of top kernel coordinate
Last modified: 2010-02-24 10:56




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P4
Severity:
normal

 

Reporter:
davbol
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2010-02-23 11:40
As of 1.0.9.

This is a trivial, low-visibility/low-significance bug, but...

Within PImage.java dilate(boolean) there two occurences of code to clamp the l/r/t/b
kernel coords at image edges. The clamp for the top coordinate incorrectly assigns
pixel[0] for all columns, currently reads:

if (idxUp<0)
idxUp=0;

should be changed to read:

if (idxUp<0)
idxUp=currIdx;

as do the similar tests for l/r/b edges.

It's very subtle, but can be seen as a 5 pixel tall "gray band" across the top of this
example:

size(200,200);
background(loadImage("milan_rubbish.jpg"));
for (int i=0; i<5; i++)
filter(DILATE);
Additional Comment #1 From fry 2010-02-24 10:56
thanks! just made the change in the two places in PImage, i'll assume we're
all set but let me know if there's a problem.