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 131111 - Aspect ratio in cropping tool
Aspect ratio in cropping tool
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
1.x
Other Linux
: Normal enhancement
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
: 61094 139074 153941 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-01-10 19:45 UTC by Jordi Gay
Modified: 2004-10-29 22:28 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
This patch applies to gimp-2pre1 base (7.44 KB, patch)
2004-01-10 19:50 UTC, Jordi Gay
none Details | Review
This patch applies to gimp-2.0pre1 base (11.12 KB, patch)
2004-02-28 11:39 UTC, Jordi Gay
none Details | Review
This patch applies to gimp-2.0pre1 base (12.64 KB, patch)
2004-02-29 00:59 UTC, Jordi Gay
none Details | Review
scale tool part of the patch (4.96 KB, patch)
2004-04-15 15:09 UTC, Sven Neumann
none Details | Review

Description Jordi Gay 2004-01-10 19:45:09 UTC
I've modified the cropt tool to allow the redimension of the selected area,
keeping the aspect ratio constant if desired. This feature allows the
especification of the desired aspect ratio and the selected zone is
automatically adjusted.
You can press the <shift> key to activate or deactivate this option while
you are selecting.
Comment 1 Jordi Gay 2004-01-10 19:50:13 UTC
Created attachment 23208 [details] [review]
This patch applies to gimp-2pre1 base
Comment 2 Sven Neumann 2004-01-10 19:53:00 UTC
Nice patch (despite the use of // which isn't portable). Should be
applied as soon as the code is branched for 2.2.
Comment 3 Pedro Gimeno 2004-01-23 10:22:02 UTC
This was already reported as bug #61094, so I'm marking this as a 
duplicate and adding a note there pointing to this patch.

We would be very grateful if the reporter can modify the patch so 
that the scale tool could benefit of the same property, as reported 
in bug #132274.

*** This bug has been marked as a duplicate of 61094 ***
Comment 4 Dave Neary 2004-01-23 10:49:52 UTC
Given that the patch is here, it makes more sense to mark bug #61094
as a duplicate of this one.

Dave.
Comment 5 Dave Neary 2004-01-23 10:51:14 UTC
*** Bug 61094 has been marked as a duplicate of this bug. ***
Comment 6 Jordi Gay 2004-02-28 11:38:05 UTC
I've fixed the unportable code commented by Sven, and added the
aspect-ratio functionality to the scale tool, as it have been
requested by Pedro.
Now there is another information field in the info box (aspect ratio),
but it cannot be changed directly. The aspect ratio is fixed when the
two options related to width and height are selected. Then the aspect
ratio is conserved while dragging and while changing the values in the
size text boxes. Now, the aspect-ratio is not recalculated at each
event, so the scale tool is more accurate in the result when dragging
or else.
Comment 7 Jordi Gay 2004-02-28 11:39:19 UTC
Created attachment 24887 [details] [review]
This patch applies to gimp-2.0pre1 base
Comment 8 Sven Neumann 2004-02-28 11:52:21 UTC
Could you explain the part where you convert between strings and
doubles. I wonder why you are using atof() and strtod(). This is ugly
and shouldn't be necessary. Is there a particular reason you are not
using a spinbutton here?
Comment 9 Jordi Gay 2004-02-29 00:58:21 UTC
You are right. The use of those functions is not a good idea.
Initially, I didn't want to use a spinbutton, but I've seen that the
use of a spinbutton is the most elegant solution. So I've changed the
patch again. Now, the aspect-ratio scaling feature is implemented with
a spinbutton.
Comment 10 Jordi Gay 2004-02-29 00:59:10 UTC
Created attachment 24915 [details] [review]
This patch applies to gimp-2.0pre1 base
Comment 11 Sven Neumann 2004-02-29 01:17:20 UTC
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (widget), TRUE) is probably
not the right thing to do. I guess you copied that from the rotate
tool where it is used for angles that wrap from 360 to 0. Apart from
that the patch looks nice. It doesn't even introduce a new string so
we could even still accept it for 2.0. Someone should give this patch
some testing then. I didn't yet around to do that.
Comment 12 Dave Neary 2004-03-01 10:21:18 UTC
Very nice patch - thank you very much.

I still think this should be committed after we branch. It's a
feature, after all, and we're a few days from a major release.

Cheers,
Dave.
Comment 13 Sven Neumann 2004-04-04 22:49:38 UTC
*** Bug 139074 has been marked as a duplicate of this bug. ***
Comment 14 Sven Neumann 2004-04-15 15:09:19 UTC
Created attachment 26689 [details] [review]
scale tool part of the patch

I am going to commit the crop tool change first, leaving the scale tool change
out. The attached patch is the part of the patch that is not yet applied.
Comment 15 Sven Neumann 2004-04-15 15:18:28 UTC
2004-04-15  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpcropoptions.[ch]
	* app/tools/gimpcroptool.[ch]: applied a patch from Jordi Gay that
	allows to keep the aspect ratio fixed.

I am closing this report as FIXED now. If you want to see the scale tool change
considered, then please open a new bug report for it.
Comment 16 Michael Natterer 2004-08-05 11:14:00 UTC
Applied the scale tool part of the patch:

2004-08-05  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpscaletool.c
	* app/tools/gimptransformtool.h: applied patch from Jordi Gay
	(attached to bug #131111) which adds an aspect ratio spinbutton to
	the scale dialog and keeps the aspect ratio intact when with or
	height are changed using the dialog. Fixes bug #132274.

	* app/tools/gimpcroptool.c
	* app/tools/gimpscaletool.c: don't set the aspect spinbuttons to
	"wrap" and decrease their climb_rate.
Comment 17 Sven Neumann 2004-10-29 22:28:00 UTC
*** Bug 153941 has been marked as a duplicate of this bug. ***