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 353936 - New crop tool doesn't stop at image borders
New crop tool doesn't stop at image borders
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other All
: Urgent major
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-09-02 06:33 UTC by Ville Pätsi
Modified: 2007-07-08 22:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ville Pätsi 2006-09-02 06:33:07 UTC
New image tool doesn't stop at image borders. This makes aspect ratio incorrect as the aspect ratio of the result is not the same as the rectangle. Snap to image border is not a valid substitute compared to the older tool.
Comment 1 Peter Fox 2006-09-04 18:58:00 UTC
I agree. I've got the same problem with 1.3.10, and find the inability to stop at the image border a show-stopper. I'm reverting to 1.2.12 for now.
Comment 2 Peter Fox 2006-09-04 19:00:44 UTC
Ok. For 1.3.10 read 2.3.10, for 1.2.12 read 2.2.12.
Comment 3 Sven Neumann 2006-09-05 06:04:46 UTC
Peter, please do not add such comments. Bugzilla is a place for tracking bugs, discussing problems and coming up with solutions. We don't need any "me too" style comments here. Thank you.
Comment 4 weskaggs 2006-09-05 17:22:22 UTC
I would be interested in opinions from Sven and Mitch about whether the crop tool *should* stop at image borders.  My tendency is to agree with Ville, but I would like to get consensus before changing the code.  The thing that makes is tricky is that the tool is capable of cropping only the active layer, and if the layer extends beyond the image, there is no obvious reason why the tool should be constrained in this way.
Comment 5 Sven Neumann 2006-09-05 18:26:24 UTC
The tool should stop at the image boundaries if the mode is "Crop Image" and at the drawable boundaries when the mode is "Crop Layer".

Oh, and IMO the "crop-mode" (Crop vs. Resize) should go away. It seems pretty much pointless to allow a crop tool to enlarge an image/layer.
Comment 6 Michael Natterer 2006-09-05 18:34:02 UTC
> Oh, and IMO the "crop-mode" (Crop vs. Resize) should go away. It seems pretty
> much pointless to allow a crop tool to enlarge an image/layer.

I pretty much agree, however the crop tool is the only interactive layer
resizing tool, and it does that job much better than the resize dialog
(guide snapping etc).
Comment 7 Sven Neumann 2006-09-05 18:55:15 UTC
IMO the only really useful way to resize a layer is "Layer to Image Size".
Comment 8 weskaggs 2006-09-06 15:48:31 UTC
Well, I've followed the recommendation to remove the "crop-mode" option, anyway.

2006-09-06  Bill Skaggs  <weskaggs@primate.ucdavis.edu>

	* app/tools/gimpcroptool.c
	* app/tools/gimpcropoptions.[ch]: remove "crop vs resize"
	option, as recommended in bug #353936.
Comment 9 weskaggs 2006-09-06 23:06:40 UTC
Pretty tricky to do this in a way that doesn't mess up the other constraints the RectangleTool has to deal with, but I took a shot at it.  Seems to mostly work, but weird things may happen if the user changes the "current layer only" option setting while the existing rectangle violates the constraints the new option setting imposes.  Also weird things may happen if an option like "fixed aspect" is set, and the user moves the pointer very quickly to a place that brings a boundary constraint into play.  Consequently I'm not going to close this bug report just yet.

 2006-09-06  Bill Skaggs  <weskaggs@primate.ucdavis.edu>

	* app/tools/tools-enums.[ch]: add GimpRectangleConstraint
	enum.

	* app/tools/gimprectangletool.[ch]: replace "constrain"
	boolean with "constraint" enum property.  Implement
	constraints in motion handler -- the implementation
	is rather elegant but pretty tricky.

	* app/tools/gimpcroptool.c: constrain to image bounds,
	or to active drawable bounds if "current layer only"
	option is checked.
	
	* app/tools/gimpellipseselecttool.c
	* app/tools/gimprectangleselecttool.c: no constraint.

	This addresses bug #353936 -- I would say fixes it, but it
	probably needs some fine-tuning.  Also perhaps fixes
	bug #329817 a bit better than before.
Comment 10 Zas 2007-03-04 09:33:24 UTC
This bug still occurs in current SVN (rev 22039).
Fixed ratio is not honoured when one hits image or layer borders.
Comment 11 Zas 2007-03-08 23:09:31 UTC
In fact, the crop tool is stopping at image borders, and that's the problem.
When you move the crop zone and it hits a border, the crop zone is modified, loosing fixed aspect if any.
 
It should behave like rectangle selection tool instead.
Comment 12 Sven Neumann 2007-03-09 07:13:11 UTC
No, it should behave as outlined in the specification that was posted to the gimp-developer mailing-list. That's why this bug is still open, it reminds us that the spec isn't fully implemented yet.
Comment 13 Zas 2007-03-09 08:03:39 UTC
I wasn't aware of that.

If there's no mistake, it is here for further reference:
http://lists.xcf.berkeley.edu/lists/gimp-developer/2006-December/016890.html
Comment 14 Martin Nordholts 2007-07-08 22:18:29 UTC
Fixed in trunk, revision 22903.

2007-07-08  Martin Nordholts  <martinn@svn.gnome.org>

	Completely rewrote logic in gimp_rectangle_tool_motion, in effect
	also fixing bug #353936 and bug #398188. The general strategy now
	is to have specialized functions doing one thing, and one thing
	only.

	The patch also makes adjusting the rectangle through the keyboard
	and through the rectangle tool options follow tool options.

	* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion):
	Completely refactored.

	(gimp_rectangle_tool_active_modifier_key):
	(gimp_rectangle_tool_update_options): Submit to tool options.

	(gimp_rectangle_tool_apply_coord)
	(gimp_rectangle_tool_clamp)
	(gimp_rectangle_tool_clamp_width)
	(gimp_rectangle_tool_clamp_height)
	(gimp_rectangle_tool_keep_inside)
	(gimp_rectangle_tool_keep_inside_horizontally)
	(gimp_rectangle_tool_keep_inside_vertically)
	(gimp_rectangle_tool_apply_fixed_width)
	(gimp_rectangle_tool_apply_fixed_height)
	(gimp_rectangle_tool_apply_aspect)
	(gimp_rectangle_tool_update_with_coord)
	(gimp_rectangle_tool_get_constraints)
	(gimp_rectangle_tool_handle_general_clamping): The new specialized
	functions.