After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 568098 - Healing Tool doesn't work at the layer borders
Healing Tool doesn't work at the layer borders
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
2.6.4
Other All
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-17 17:08 UTC by Carlos
Modified: 2012-05-10 18:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Heal-Make-HealTool-work-when-brush-is-partially-outs.patch (1.48 KB, patch)
2011-04-01 20:39 UTC, Enrico Schröder
needs-work Details | Review
Fixes the wrong row stride at layer edges. (2.03 KB, patch)
2012-05-07 23:09 UTC, Mike Henning (drawoc)
none Details | Review
Patch against 2.8 branch. (6.79 KB, patch)
2012-05-08 21:00 UTC, Mike Henning (drawoc)
none Details | Review

Description Carlos 2009-01-17 17:08:41 UTC
Please describe the problem:
The Healing Tool does not work when your brush is partially outside the image. If a part of the brush is out of the image canvas, then the tool does not work.

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Enrico Schröder 2011-04-01 20:39:02 UTC
Created attachment 184900 [details] [review]
0001-Heal-Make-HealTool-work-when-brush-is-partially-outs.patch

I wrote a patch for that bug:

Removes condition for not applying heal when (destination)brush is partially outside of layer.
Instead heal is not applied when brush is completely outside.

I have removed the conditions which cancel healing when destination is partially outside of layer. In case the healing really needs to be canceled (when the source is outside) it gets canceled through one of the other conditions anyway, so my patch should not make anything worse. I also added a check which cancels healing when the destination is completely outside of layer.
Comment 2 Carlos 2011-04-01 20:51:35 UTC
Thanks for the patch. I am waiting for it since 2009-01-17
Comment 3 Michael Natterer 2011-04-08 22:41:40 UTC
That patch is unfortunately completely broken. The result is complete
noise, or almost no effect when painting partially off-image.
Comment 4 Martin Nordholts 2011-04-09 16:09:01 UTC
Review of attachment 184900 [details] [review]:

needs-work as per mitch's comment
Comment 5 Alexia Death 2012-04-24 19:23:14 UTC
Problems this patch had seem to have been corrected by patch in bug 674543. Committed as provided. 

commit 8cd272bb8024886822185e9c39be276bf1c97a4e
Author: Enrico Schröder <enni.schroeder@gmail.com>
Date:   Fri Apr 1 22:19:34 2011 +0200

    Heal: Make HealTool work when brush is partially outside of layer
    
    Fix for bug 568098 https://bugzilla.gnome.org/show_bug.cgi?id=568098
    Removes condition for not applying heal when (destination)brush is partially outside of layer.
    Instead heal is not applied when brush is completely outside.
Comment 6 Mike Henning (drawoc) 2012-04-25 01:33:48 UTC
This should be backed out.

Sorry, I forgot to mention that there are issues to this patch other than that one specific issue of corruption - mainly that the code assumes the brush mask is the same size as the affected area, so gimp_heal_laplace_iteration is reading the wrong values from the mask when the brush is off the edge.

You can test this if you use it w/ the pepper brush near the edge of an image.
Comment 7 Alexia Death 2012-04-26 05:50:35 UTC
I see... I don't think its big enough of a defect to warrant a revert tho. It causes the heal to not function perfectly at top/right edges. It's fine on the bottom.
Comment 8 Alexia Death 2012-04-26 05:51:51 UTC
reopening tho, as something that needs a little more attention.
Comment 9 Mike Henning (drawoc) 2012-05-07 23:09:29 UTC
Created attachment 213629 [details] [review]
Fixes the wrong row stride at layer edges.

Okay. Well, anyway here's a full fix for this bug. Patch is against master.
Comment 10 Alexia Death 2012-05-08 10:24:22 UTC
Could you do a patch against 2.8 branch as well?
Comment 11 Mike Henning (drawoc) 2012-05-08 21:00:27 UTC
Created attachment 213707 [details] [review]
Patch against 2.8 branch.

Sure. Here's a patch against 2.8.

This one's a bit more complicated because I didn't have the GEGL rectangles to simply shift over a bit. Wound up passing a PixelRegion around for the mask.
Comment 12 Alexia Death 2012-05-10 17:49:01 UTC
Committed the master variant. Mitch is looking at the 2.8 patch. Thanks for great work:)

commit 15a85744bad6b5c9d44946d7daa831f87ec620db
Author: Michael Henning <mikehenning@eclipse.net>
Date:   Mon May 7 18:57:57 2012 -0400

    app: Fix heal tool behavior at top and left edge (Bug 568098)
    
    Fixes calculation of the mask buffer's rectangle.
Comment 13 Michael Natterer 2012-05-10 18:14:55 UTC
Fixed in 2.8:

commit fa8a5a63ab42e8780bc3c379d50b2ac4e6a76463
Author: Michael Henning <mikehenning@eclipse.net>
Date:   Tue May 8 16:39:38 2012 -0400

    Bug 568098 - Healing Tool doesn't work at the layer borders.
    
    Fixes the row stride for the brush mask.

 app/paint/gimpheal.c |   59 +++++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 39 insertions(+), 20 deletions(-)