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 87789 - Want pref that resizes layers when canvas is resized
Want pref that resizes layers when canvas is resized
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
Daniel Egger
Depends on:
Blocks:
 
 
Reported: 2002-07-10 00:32 UTC by Akkana Peck
Modified: 2005-02-24 16:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
very simple patch to implement the resize (1.55 KB, patch)
2002-07-10 06:22 UTC, Akkana Peck
none Details | Review
patch against 1.2.4: fix offset handling (810 bytes, patch)
2002-07-13 17:35 UTC, Akkana Peck
none Details | Review
The real attachment, with UI (against 1.3 CVS tip) (6.58 KB, patch)
2002-07-13 20:33 UTC, Akkana Peck
none Details | Review
Much better patch (7.35 KB, patch)
2002-07-13 22:25 UTC, Akkana Peck
none Details | Review

Description Akkana Peck 2002-07-10 00:32:21 UTC

Comment 1 Akkana Peck 2002-07-10 00:36:48 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.
Comment 2 Akkana Peck 2002-07-10 06:22:51 UTC
Created attachment 9766 [details] [review]
very simple patch to implement the resize
Comment 3 Akkana Peck 2002-07-10 06:26:17 UTC
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.
Comment 4 Raphaël Quinet 2002-07-10 07:19:04 UTC
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...
Comment 5 Akkana Peck 2002-07-13 17:35:12 UTC
Created attachment 9844 [details] [review]
patch against 1.2.4: fix offset handling
Comment 6 Akkana Peck 2002-07-13 17:40:41 UTC
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.
Comment 7 Akkana Peck 2002-07-13 20:33:52 UTC
Created attachment 9846 [details] [review]
The real attachment, with UI (against 1.3 CVS tip)
Comment 8 Akkana Peck 2002-07-13 21:04:43 UTC
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).
Comment 9 Akkana Peck 2002-07-13 22:25:50 UTC
Created attachment 9847 [details] [review]
Much better patch
Comment 10 Alan Horkan 2003-07-23 18:39:53 UTC
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.  
Comment 11 Dave Neary 2003-07-26 10:33:21 UTC
Bumping a bunch of enhancement requests which will not be done by the feature
freeze to Future. 

Dave.
Comment 12 Dave Neary 2004-08-09 15:09:33 UTC
Comment on attachment 9844 [details] [review]
patch against 1.2.4: fix offset handling

Obsoleting old patch
Comment 13 Dave Neary 2004-08-09 15:09:55 UTC
Comment on attachment 9766 [details] [review]
very simple patch to implement the resize

Obsoleting old patch
Comment 14 Michael Natterer 2005-02-24 13:29:42 UTC
Will care about applying some variant of the patches above. Setting
milestone to 2.4.
Comment 15 Michael Natterer 2005-02-24 16:39:34 UTC
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.