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 559716 - Changing crop size in Crop Tool Options can make UI unresponsive
Changing crop size in Crop Tool Options can make UI unresponsive
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
2.6.2
Other All
: Normal critical
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 573860 628788 635457 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-07 09:05 UTC by Andi Clemens
Modified: 2011-03-21 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a video showing the issue (688.65 KB, application/octet-stream)
2008-11-07 09:06 UTC, Andi Clemens
  Details
crop-options-lock-ui-2008-11-08.patch (2.24 KB, patch)
2008-11-08 09:33 UTC, Martin Nordholts
committed Details | Review
Adjust mitch's fix slightly to be safer when dealing with floating-point numbers (1.11 KB, patch)
2011-03-21 14:50 UTC, Omari Stephens
committed Details | Review

Description Andi Clemens 2008-11-07 09:05:56 UTC
Steps to reproduce:
1. Position the crop tool in the image
2. Set the size of the tool in its settings dialog, choose a size bigger as the image or at least so big that it will jut out of the image
3. The tool flickers and Gimp doesn't respond anymore


Stack trace:


Other information:
Comment 1 Andi Clemens 2008-11-07 09:06:51 UTC
Created attachment 122173 [details]
a video showing the issue
Comment 2 Michael Schumacher 2008-11-07 09:30:28 UTC
I seem to be unable to adjust the settings to do this. Please provide exact steps in written form that allow others to reproduce the problem..
Comment 3 Andi Clemens 2008-11-07 09:36:03 UTC
Oh right it seems like it is only happening when you have a small image. Try it this way (as seen in the video):

1. Scale down an image so that one side will be 60px (my example was 60x90 or so)
2. Now position the tool somewhere in the image, but not in the top left corner (not 0,0), maybe try (10,10)
3. Set the size of 60x60 in the settings dialog of the crop tool, it will start to flicker and Gimp will not respond anymore.
Comment 4 Michael Schumacher 2008-11-07 09:42:22 UTC
I'm still unable to reproduce this problem.
Comment 5 Michal 2008-11-07 11:09:41 UTC
I can confirm this bug in GIMP 2.6.1. 
Steps to reproduce:
1. Create new image size 99x60 px
2. Change zoom level to 550%
3. Select "Crop tool"
4. Start selecting some area on the image with crop tool
5. In crop tool settings set the size 90x60 px
  
Comment 6 Andi Clemens 2008-11-07 11:40:06 UTC
Oh right, I guess zooming is the important step... didn't thought about that.
Comment 7 Martin Nordholts 2008-11-07 22:42:51 UTC
I can reproduce. Not a crash in the technical sense though.
Comment 8 Martin Nordholts 2008-11-08 09:33:47 UTC
Created attachment 122223 [details] [review]
crop-options-lock-ui-2008-11-08.patch

The cause of this bug is a combination of sub-pixel representation of the crop rectangle, clamping of the entered height, integer-only entries in the tool options, and very intolerant checks in gimp_rectangle_tool_options_notify() for the height.

It should be fine to loosen up the checks for x, y, width and height. I have not been able to reproduce the UI lockup with the patch applied even though it's rather easy without the patch applied.

I will do some more testing before I commit.
Comment 9 Martin Nordholts 2008-11-10 20:20:10 UTC
Seems to work fine, committed to trunk (rev 27605) and gimp-2-6:

2008-11-10  Martin Nordholts  <martinn@svn.gnome.org>

	Bug 559716 – Changing crop size in Crop Tool Options can make UI
	unresponsive

	* app/tools/gimprectangletool.c: Accept a broader range of x, y,
	width and height values from the tool options so we don't end up
	in an infinite signal emission loop.
Comment 10 Ingo Ruhnke 2010-07-14 09:27:27 UTC
This bug is still be present in Gimp 2.6.8 as shipped with Ubuntu 10.04. Steps to reproduce:

- create an image (685x1024)
- create a crop area smaller then the image with the mouse (520x406+88+108)
- increase the width of the crop area in the dialog beyond the image size (5200x406) and hit tab
- endless loop follows

- if no endless loop follows, move the top/left corner of the crop area around with the mouse and then enter another size bigger then the image, might take a few tries to get into the endless loop
Comment 11 Martin Nordholts 2010-07-18 15:29:00 UTC
Ok :( Reopening then.
Comment 12 Michael Natterer 2011-03-21 13:32:16 UTC
*** Bug 628788 has been marked as a duplicate of this bug. ***
Comment 13 Michael Natterer 2011-03-21 13:32:54 UTC
*** Bug 635457 has been marked as a duplicate of this bug. ***
Comment 14 Michael Natterer 2011-03-21 13:35:00 UTC
*** Bug 573860 has been marked as a duplicate of this bug. ***
Comment 15 Michael Natterer 2011-03-21 13:41:08 UTC
Fixed in master:

commit ec1108d62a671279779514c66dab15b0ca65c24b
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Mar 21 14:38:26 2011 +0100

    Bug 559716 - Changing crop size in Crop Tool Options can make UI unresponsive
    
    In gimp_rectangle_tool_update_options(), freeze()/thaw() notifications
    around setting setting x, y, width, height, so all values are
    up-to-date when "notify" is emitted. Also, only set the values that
    have actually changed so we don't process notifications when no change
    was done.

 app/tools/gimprectangletool.c |   43 ++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 17 deletions(-)
Comment 16 Omari Stephens 2011-03-21 14:50:07 UTC
Created attachment 183941 [details] [review]
Adjust mitch's fix slightly to be safer when dealing with floating-point numbers