GNOME Bugzilla – Bug 353936
New crop tool doesn't stop at image borders
Last modified: 2007-07-08 22:18:29 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.
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.
Ok. For 1.3.10 read 2.3.10, for 1.2.12 read 2.2.12.
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.
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.
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.
> 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).
IMO the only really useful way to resize a layer is "Layer to Image Size".
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.
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.
This bug still occurs in current SVN (rev 22039). Fixed ratio is not honoured when one hits image or layer borders.
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.
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.
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
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.