GNOME Bugzilla – Bug 87789
Want pref that resizes layers when canvas is resized
Last modified: 2005-02-24 16:39:34 UTC
(Sorry about that empty bug; I hit return with focus in the summary and it submitted!) Resizing an image in gimp is currently always a 2-or-more-step operation for me: resize the canvas, then do "layer to imagesize" on any layer where I might need to make a change. (Also, when I was just learning gimp, I could never figure out why I couldn't draw in the new area after resizing; and just now someone on #gimp was having trouble figuring it out.) It would make this operation much simpler if gimp resized any layer that was already the old image size to the new canvas size. If this isn't something that everyone would want, perhaps it could be put on a preference.
Created attachment 9766 [details] [review] very simple patch to implement the resize
I attached a patch that resizes any layer that started out the same size as the image before the resize. It passes in the offset, but I haven't tested that aspect of it, so this probably needs some tweaking. It's not on a pref in this patch -- I wanted to ask first whether it was better to make it always happen (probably not or it would be doing that already, right?), on a pref, or on a toggle button in the resize dialog.
I do not want this to become the default behavior. It would be really annoying for some of the tasks that I perform on some images. I think that it would be better to have a checkbox (default off) attached to the resize dialog. This would be better than adding another option in the preferences dialog because this is an option that may be toggled frequently depending on the image you are working on (the same applies to the type of interpolation used when scaling up/down). Another option would be to provide three choices (small menu? radio buttons?) in the resize dialog: - shift layers, do not resize them - resize layers if they had the same size as the canvas - resize all layers to the new canvas size But we need to find a more concise wording...
Created attachment 9844 [details] [review] patch against 1.2.4: fix offset handling
Offset handling is wrong in the first patch. The second patch (against 1.2.4-pre1) fixes the logic and shows where the fix goes in 1.2. I'll holdoff on the revised 1.3 patch since I still need to add code to make the behavior optional.
Created attachment 9846 [details] [review] The real attachment, with UI (against 1.3 CVS tip)
Whoops, sorry, disregard that last patch (and sorry for the extra traffic). There are two bugs in it: (1) only checks width of the old layer, not height (typo, easy fix), and (2) in "resize all" mode, layers come out offset wrong (working on it).
Created attachment 9847 [details] [review] Much better patch
Changes at the request of Dave Neary on the developer mailing list. I am changing many of the bugzilla reports that have not specified a target milestone to Future milestone. Hope that is acceptable.
Bumping a bunch of enhancement requests which will not be done by the feature freeze to Future. Dave.
Comment on attachment 9844 [details] [review] patch against 1.2.4: fix offset handling Obsoleting old patch
Comment on attachment 9766 [details] [review] very simple patch to implement the resize Obsoleting old patch
Will care about applying some variant of the patches above. Setting milestone to 2.4.
Fixed in CVS: 2005-02-24 Michael Natterer <mitch@gimp.org> Allow to resize layers with the image. Fixes bug #87789. * app/core/core-enums.[ch]: added enum GimpImageResizeLayers which can be one of { NONE, MATCHING, ALL }. * app/core/gimpimage-resize.[ch]: added new function gimp_image_resize_with_layers(). * app/dialogs/resize-dialog.[ch]: added a "Layers" frame containing a "Resize Layers" combo box offering the choices above. Changed GimpResizeCallback signature accordingly. * app/actions/image-commands.c * app/actions/layers-commands.c: changed accordingly.