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 508183 - Crop tool to once again display selection aspect ratio along with size (in status?)
Crop tool to once again display selection aspect ratio along with size (in st...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
2.4.x
Other All
: Normal trivial
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on: 55364
Blocks:
 
 
Reported: 2008-01-08 23:27 UTC by Tim M
Modified: 2012-09-03 10:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rectangle-tool-aspect-ratio-in-statusbar-2008-05-28.patch (3.57 KB, patch)
2008-05-28 17:24 UTC, Martin Nordholts
none Details | Review

Description Tim M 2008-01-08 23:27:54 UTC
Like many, I use gimp to resize images for photos.  A lot of time gets spent cropping.  Previous versions (2.2) used to open a clumsy yet informative dialog on crop as now appears more succinctly in the tool info (thanks!).

However, the current aspect ratio of the selection is no longer shown.  I can preselect a fixed one (handy yet this this is a "fancy" feature in comparison).  I can also see the dimensions of my selection in pixels/mm/picas in TWO places (in the tool info, and at the bottom of the image window in the status bar "Rectangle: 34x453").  I can display the size of my selection in several fancy ways, but not its aspect any more.

It would be a trivial change to put the aspect ratio into the status format string "Rectangle: 2342x4543   Aspect: 1.543"   Even if shared with all rectangle selections, it would be helpful information.  If that's not ok, is there some way it can be resurrected in the crop tool info?

When you want to print/paint a photo, you want the flexibility to drag a rectangle around and figure out whether you should crop to a 1:1 or a 2:3 or a 3:4 or 4:5, etc on the fly.  Who knows what the best image crop is!

This would address most of entry #156858.  You don't really need complicated preselected aspect ratios if you can just see your current.

I've been using GIMP since 1996.  Thanks, guys, it's amazing.
Comment 1 Sven Neumann 2008-01-09 10:15:28 UTC
Yeah, I never understood the rationale behind the decision of the UI team to hide this information and display "Current" instead. The reasons are probably outlined in http://gui.gimp.org/index.php/Selection_%2B_crop_tool_specification.

Let's set this on the 2.6 milestone and see if we can do anything about it.
Comment 2 Martin Nordholts 2008-01-09 18:31:55 UTC
(In reply to comment #1)
> Yeah, I never understood the rationale behind the decision of the UI team to
> hide this information and display "Current" instead.

The discussion leading up to this can be followed in bug #479999.

Showing the aspect ratio in the status bar does sound useful and it would indeed be trivial to do. I'll hack up a patch for that this weekend (unless someone else does it before me).
Comment 3 Sven Neumann 2008-01-09 19:37:57 UTC
Seriously, the status-bar is not really a good place for this. It's fine to also display it there but I would like to keep this report open until Peter has seen it.
Comment 4 Tim M 2008-02-01 11:56:08 UTC
Ah, thanks.  I checked the impressively extensive crop tool redesign spec docs mentioned, but did not find mention of displayed aspect.  I imagine people just forgot to bring it over.  I probably would.

I was using GIMP again and severely missing this again.  

OK, if the status bar isn't a good place for it, what is?

1. The crop/select tool option area is a schmorgasboard of widgets.  All of them are editable controls.  Adding an aspect label widget there would not only add to the clutter, it would be functionally out of place.  If added as an editable text field, then the question is-- what would happen if it were edited?  Would width or height first be consulted as an input?  What about zero?  Since it is a combination of X,y/width,height it doesn't fit in the Position:/Size: area.  Shoving it into the editable field below Fixed: area in Aspect Ratio does not really work, since reporting 453:734 is not actually useful.  Adding it here is Complicated.  Complicated things rarely get done for good reason.  

2. The lower left hand corner of the document window is for X,Y information and reports mouse coordinates.  This does not belong here, or in zoom information.

The point of a status bar is to concisely describe useful information about the current action.  It sounds exactly like what we have here to me.  

Does using the white space in the status bar to the right of "Rectangle: 342x643" constitute clutter-- especially since that only displays during mouse drag operations?

Thanks, Tim
Comment 5 peter sikking 2008-02-03 15:18:55 UTC
Sven is right, why hide it in the status bar...

I got a solution for you and it is made with cairo:

While rubber-banding, display rect size (hmmmm, units) and aspect ratio on the canvas, right in the middle of the rect. when the rect is too small, display outside the rect (algorithm too subtle to elaborate here). background of this display area can be something like 80% opaque black, text 100% opaque white. text size neither too small (9pt) nor too big (36pt).

it would be cool if the ratio would find useful integer ratios (2:3), although there is a threshold somewhere were it stop being enlightening (107:37 is not).

what do we think..?
Comment 6 Martin Nordholts 2008-02-03 15:26:25 UTC
I like it, we just need to fix Cairo drawing for tools first.
Comment 7 Sven Neumann 2008-05-27 19:14:15 UTC
Why don't you just show the ratio in the status-bar instead of bumping this to the next release?
Comment 8 Martin Nordholts 2008-05-28 17:24:28 UTC
Created attachment 111675 [details] [review]
rectangle-tool-aspect-ratio-in-statusbar-2008-05-28.patch

Patch that uses the same logic as the number pair entry for converting rectangle ratio to nom:denom, and showing it in the status bar.

With the above simple approach, it isn't very useful unfortunately. It is hard to get a "feel" of the aspect ratio just by looking at the numbers provided.

In order to make this useful, it will be necessary to implement a more complicated logic. Let's bump this to 2.8.
Comment 9 Tim M 2008-05-28 23:40:06 UTC
Wait!  Wonderful!  Thank you, that's indeed the change.
Except one small thing, I agree, "432:643" is highly confusing whereas 
432/643 = "0.657" would be incredibly useful, what used
to be there, and why this whole feature request was made.
Ah, it's so hard to see it come so close then miss!

What about simplifying down to the following?  I imagine
you'd want a digit constraint on the printf for h/w here as well.
Then I wouldn't have to go to emacs and eval "(/ 1839.0 2163.0)"
each time to get an aspect ratio on my selection, then reiterate
until I get close to the desired, which is noticeably clumsy.

Thank you!

Index: app/tools/gimprectangletool.c
===================================================================
--- app/tools/gimprectangletool.c	(revision 25834)
+++ app/tools/gimprectangletool.c	(working copy)
@@ -1074,8 +1074,27 @@ gimp_rectangle_tool_motion (GimpTool    
       h = pub_y2 - pub_y1;
 
       if (w > 0.0 && h > 0.0)
-        gimp_tool_push_status_coords (tool, display,
-                                      _("Rectangle: "), w, " × ", h, NULL);
+        {
+          gchar   *aspect_text;
+
+          aspect_text = g_strdup_printf (_(" Aspect ratio: %g"),
+                                         w / (gdouble) h);
+
+          gimp_tool_push_status_coords (tool, display,
+                                        _("Rectangle: "), w, " × ", h, aspect_text);
+
+          g_free (aspect_text);
+        }
     }


Comment 10 Martin Nordholts 2008-05-29 04:29:27 UTC
Oh then I misunderstood. The plain aspect ratio is indeed more useful. Let's go for that in 2.6. I'll use the string "  .2f" instead of " Aspect ratio: %g" though since the former results in considerable less status-bar noise. It should be obvious to users that the number is the aspect ratio.

Commited to trunk, rev 25847:

2008-05-29  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangletool.c (gimp_rectangle_tool_motion): Also
	show the plain aspect ratio in the status bar along with the
	rectangle size information.

It would be nice if the aspect ratio information had a constant position in the statusbar so it wouldn't jump around when the size of the rectangle changes, but let's consider the current approach a quickfix and go for a real solution in 2.8.
Comment 11 Tim M 2008-05-30 02:40:15 UTC
True, it should be obvious what it is without the " Aspect ratio: " tag.  Nice.

Ah, fabulous.  Thank you.  I'm looking forward to using it.

Comment 12 Martin Nordholts 2010-01-15 20:55:18 UTC
We should display this on-canvas using ciaro. Moving to 2.10.
Comment 13 Martin Nordholts 2011-03-14 07:27:20 UTC
Low priority compared to things on our roadmap
Comment 14 Michael Natterer 2012-09-03 10:54:33 UTC
It is displayed in the status bar now, good enough. Everything else
is an enhancement and needs to be speced out anyway.