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 156858 - Add option menu of standard aspect ratios to ratio-using tools
Add option menu of standard aspect ratios to ratio-using tools
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
2.1.x
Other All
: Normal enhancement
: Future
Assigned To: GIMP Bugs
GIMP Bugs
: 169064 337663 338948 406542 563338 739249 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-10-29 22:08 UTC by Jamie Zawinski
Modified: 2017-06-11 23:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jamie Zawinski 2004-10-29 22:08:49 UTC
I use crop constantly when editing photos.  I always want my photos to be either
4x6 or 6x4.  Right now I can do that by being careful with the crop tool: any
time I want to crop, I have to first select the whole image; then resize my crop
region with the shift key held down to keep that ratio.  If I want to crop a
landscape image out of a portrait image, or vice versa, then I have to keep an
eye on the ratio number in the tool dialog and get as close to "1.5" or "0.67"
as I can.

This works, but it, well, sucks.

In bug 61094 I pointed out how iPhoto does this: their crop tool has an option
menu on it with these choices:

    None
    Display (1280 x 1024)
    4:3 (Book, DVD)
    4:6
    5:7
    8:10
    4:3 Portrait
    4:6 Portrait
    5:7 Portrait
    8:10 Portrait
    Square

I would really, really like to see that in the Gimp crop tool.

The "Keep aspect ratio" option is useful in some situations; if you have an
arbitrarily-dragged-out region and you want a larger version of that same region.  

But that's not mostly what I do.  I want a specific ratio at all times.  And it
sure would be nice to be able to get that with an option menu or a checkbox
instead of having to hold down shift the whole time.  I figure that fully half
of the time I spent in Gimp is with the shift key held down.  That's weak.

So I know you already marked this request "fixed" when bug 131111 resulted in
the addition of the "keep aspect ratio" tool.  But I think the option menu is
still needed.
Comment 1 Sven Neumann 2004-10-29 22:21:50 UTC
That would be a duplicate of bug #153941 then. But I think there has even been
one that suggested to use templates for the Crop and Scale tools. Everyone
agrees that the crop tool is crap and all this has been suggested already. That
is not the point.

*** This bug has been marked as a duplicate of 153941 ***
Comment 2 Sven Neumann 2004-10-29 22:26:29 UTC
Oh, you even marked the report I was looking for. Stupid me.
Comment 3 weskaggs 2005-03-03 17:03:15 UTC
*** Bug 169064 has been marked as a duplicate of this bug. ***
Comment 4 Joao S. O. Bueno 2005-03-04 01:43:12 UTC
I still think the idea of a swap button, like asked in bug 169064 might be 
interesting. 
 
For once, this list would have to be double in size if there is no such an 
option. And, a "swap aspect ratio" can have an action assigned to it, and 
therefore be faster to get to. When working on a series of photos, I miss this 
too. 
 
Maybe the "portrait" and "landscape" buttons from new image dialog could be 
used here. 
Comment 5 Sven Neumann 2005-03-04 10:22:07 UTC
Sure, the "portrait" and "landscape" buttons are an obvious choice here. We
would not want to include all aspect ratios in both landscape and portrait. We
don't do that for templates neither (and we might want to reuse templates here
anyway).
Comment 6 Sam @ EG Photography 2005-06-06 05:46:21 UTC
I am going to throw another log on this fire.  I am a constant user, and a PS
convert.  I would LOVE the ability to select a DPI/Size Template for the crop
tool and have it select areas of the image based on the aspect ratio it
calculates from the template size entered, and then resize the image after the
crop action has occurred to meet the DPI constraints in the template file.

I perform this operation over 100 times a day, and we use PS to do it right now.
 It is one of the last holdouts for us from PS.  

The other feature that we think would be KILLER in gimp that we have not found
yet is the ability to add a layer similar to a layer mask on an image, and then
do operations such as color correction, levels, and other effects on that layer
separately.  It would be like a hierarchy of linked layers.  Perhaps it does
this, but we have not figured it out yet.  
Comment 7 weskaggs 2005-06-06 16:12:51 UTC
I don't quite understand your first paragraph.  What is a "DPI/Size Template"?

Comment 8 Sam @ EG Photography 2005-06-07 16:58:54 UTC
Usually in photography, I will set a resolution for printing that is represented
as "Dots Per Inch" (DPI).  For example, my photo print house needs 300 DPI to
produce an excellent print, so a 4"x6" print will be 1200x1800 in resolution.  

As such, I would like the crop/resize tool to have the ability to take a
template that will allow me to crop an image based on a fixed aspect ratio
(example:  for a 4x6 it would be 2/3 or .666), and then automatically resize it
based on the amount of DPI that I specify to get the print size I need ( in the
case of the 4x6, 1200x1800). 

If I were designing this modification to the crop tool, as things are structured
right now, I would add a third radio button called "Print Crop", and have a
template list and a set of quick entry boxes with the option to save as a
template to the dialog when this radio button is selected.  These templates
could be shared with the "New File" dialog, as well, as all of the needed data
is present there. 
Comment 9 Evert Verhellen 2005-11-26 03:09:21 UTC
I also crop pictures all the time. Because some are landscape (4:3) and some are
portrait (3:4) one has to adjust the "fixed aspect ratio" constantly from 3:2
towards 2:3 and vice versa (which needlessly drags down productivity).

The GIMP should be able to change the width and height of the aspect ratio
automatically though. E.g.:

 1. I open a landscape image (3072x2304) in the GIMP.
 2. I manually set the "fixed aspect ratio" to 3:2.
 3. I select a rectangular region and crop the image.

 4. I open a portrait image (2304x3072) after that.

Expected results:
The GIMP should now automatically guess that I require an aspect ratio of 2:3
instead (because of the changed image orientation) and set these values in the
tool dialog accordingly.

Actual results:
I have to do this manually.

The GIMP should also supply a list of standard aspect ratios in a drop-down (in
Apple Aperture this is called "Common Sizes" I think). This will also save a lot
of time. Maybe there should be a checkbox to quickly toggle the orientation of
the aspect ratio as well.
Comment 10 Michael Schumacher 2006-04-08 09:16:13 UTC
*** Bug 337663 has been marked as a duplicate of this bug. ***
Comment 11 Alexander Rabtchevich 2006-04-08 09:35:57 UTC
Personaly I do not want GIMP to decide which aspect ratio to use: portrait or landscape, because sometimes I make portrait crops from landscape images. The second objection is the exact aspect ratio depends on print sizes. F.i.
10x15" 300 dpi is 1205x1795 and aspect ratio is 1.489626556016598
13x18" 300 dpi is 2102x1500 and aspect ratio is 1.401333333333333

The first fact is the aspect ratios depend on print sizes. The second fact is this ratios and displayed labels should be added/edited by user.
Comment 12 Sven Neumann 2006-04-21 09:03:53 UTC
*** Bug 338948 has been marked as a duplicate of this bug. ***
Comment 13 Albert Cahalan 2006-04-22 06:36:15 UTC
Portrait/landscape can be chosen as the crop is made. Portrait selections are those with |dx| < |dy|, and landscape selections are those with |dx| > |dy|. When |dx| = |dy|, either will do.
Comment 14 Albert Cahalan 2006-04-22 06:42:34 UTC
There is also the matter of snapping to exact ratios. In 16:9 mode, an 8x4 or 8x5 image would violate this.
Comment 15 Tim Jedlicka 2006-05-12 05:05:24 UTC
In bug 169064 which was dupped to this one, I suggested an "invert aspect ratio" type option. I've been playing with gimp-2.3.x and the new crop tool. Even if a pull down of "standard" apsect ratios is eventually implemented, it will be beneficial to have an "invert ratio" button (i.e. change aspect from portrait=8x10 to landscape=10x8) rather than list both ratios in the list. Depending on how the list is implemented the "invert aspect" is the same as portrait versus landscape.

I poked around in the code but couldn't quite figure out a patch. 
Add a "Invert Aspect Ratio" button in app/tools/gimprectangleoptions.c
+ button = gimp_prop_check_button_new (config,"invert-aspect",_("Invert_Aspect"));

Then in app/tools/gimprectangletool.c add the invert:

  if (fixed_aspect)
    {
      gdouble aspect;
      g_object_get (options, "aspect", &aspect, NULL);

      if (aspect < 1.0 / max_y)
        aspect = 1.0 / max_y;
      if (aspect > max_x)
        aspect = max_x;
+     if (invert_aspect)
+       aspect = 1 / aspect;
Comment 16 Albert Cahalan 2006-05-12 05:31:24 UTC
Regarding Comment #15, please see Comment #13.

There is no need for a button or checkbox.
There is no need to list both ratios.

An "exact ratio only" button would be good though.

Being able to enter a required GCD (greatest common denominator)
would be nice too, defaulting to 1 of course.
Comment 17 Tim Jedlicka 2006-07-28 03:58:09 UTC
This suggestion was on the developer list - I thought it deserved to be captured in the bug report as well.
On 7/27/06, Frédéric <frederic.mantegazza@gbiloba.org> wrote:
    A nice feature could be to automatically switch from x:y to y:x. This could
    be done by detecting the first move and assigning the largest value of the
    ratio to that direction.

    For example, if user choose 3:2 ratio, and then first move cursor
    horizontally during drag, the ratio will be 3:2. If user first move cursor
    vertically, then ratio will be 2:3.
    
    Another way could be to use a key modifier, like Shift or Alt.
Comment 18 Albert Cahalan 2006-07-28 05:08:36 UTC
Regarding Comment #17

Automatic switching is good, but "first move" is very bad.
The user might twitch the mouse by a pixel before moving
in the desired direction. Modifiers are awful for this.

Better: just use the current location, flipping between
the two ratios as needed.

dx = old_x - new_x;
dy = old_y - new_y;
orientation = abs(dx) > abs(dy);

(without continuous automatic switching, the angle from
origin to current mouse location is totally wasted unless
rotation is also being done)

Better uses for modifiers:

1. snap to exact ratio (example: when cropping 401x300 with 4:3 ratio, the nearest exact ratio dimensions are 400x300)

2. snap to grid
Comment 19 Alexander Rabtchevich 2006-07-30 17:33:25 UTC
Why do you want to introduce some RESTRICTIONS by truncation, roundings and so on? This only makes the life hardier. If I (and photo printing lab) need 1205x1795 for 10x15 cm or 2102x1500 for 13x18 cm that means exact values and exact ratios without any roundings.
Comment 20 Sven Neumann 2006-08-07 07:54:28 UTC
Switching the ratio would probably best be implemented by adding buttons for portrait/landscape to the tool options, just like we have them in the New Image dialog.
Comment 21 John Kane 2006-11-29 04:53:38 UTC
Without a better example in mind and I hope no gimp developers are offended I find the Aspect Ratio Crop tool in digikam to be most intuitive, drop down menu for most common ratios with the ability to enter  your own and a toggle between portrait or landscape, the default ratio depending on the aspect of the image itself. This is very helpful to those of us working with photos.
As it is now I find it more productive to use the selection tool with a fixed aspect ratio to crop then bothering with the what seems to me an unweildy crop tool.
Comment 22 Albert Cahalan 2006-11-29 05:32:31 UTC
(In reply to comment #21)
> Without a better example in mind and I hope no gimp developers are offended I
> find the Aspect Ratio Crop tool in digikam to be most intuitive, drop down menu
> for most common ratios with the ability to enter  your own and a toggle between
> portrait or landscape

Why would you want to press a button that you don't need to press?
Think about comment #16 and comment #18 for a bit.

Another example, assuming this is a corner-corner selection
rather than a center-corner selection:

Suppose you choose 2:3 as the ratio. Suppose you push down the mouse
button at 500,500 in a 1000x1000 image, then move the mouse.

Mouse distance from 500,500 determines the diagonal measurement.
If the mouse moved more horizontally, choose landscape mode.
If the mouse moved more vertically, choose portrait mode.
If the mouse moved in the +x and -y direction, locate the crop
region in the upper right quadrant with the lower left corner
at 500,500. And so on for the other 3 quadrants...

Comment 23 John Kane 2006-11-30 15:40:47 UTC
Its my opinion that its easier to chose portrait nor landscape first as anything that depends on more vertical or horizontal mouse momements instead of just moving the mouse to simply resize and move the selection where you want it, it becomes a matter of moving the mouse in an unnatural direction of more verical or horizontal watching as your selections spaz out between portrait and landscape as gimp tries to decide which direction your hand is moving more in.
To you it probably sounds silly that moving the mouse more up or down would seem like a burden to me or others but it seems equally silly to me that someone would mind pushing a button that would be set at the default of the original image making the need to push that button more unlikely. Most of my own aspect ratio crops are in the same ratio and portrait/landcape mode as the original image so pushing that button would be something I have to do most sparingly but if the mouse movement decides I am forced to think about which way the mouse is moving more or less every time.
Its been my experience that anything that gets decided by mouse movements tends to be flakey when you dont want flakey and adds to more wear and tear on the mouse hand, those of you who dont get chronic tendonitus might not care but its a problem for some of us.
This is why I wind up doing almost all my cropping in digikam and showfoto and almost never in the gimp as it almost is alway a lot more hassle in the gimp.
Feels most non intuitive and time consuming.
Comment 24 Albert Cahalan 2006-11-30 17:29:27 UTC
(In reply to comment #23)

No, actually I do have serious hand problems, and this is one reason why the extra button push is bad. With every button push, bits of metal shrapnel grind around in my hand. (and really, if your mouse control is so bad that you can't operate the selection right, you'll miss the button anyway -- you need a purely non-mouse interface and might even prefer a script invoked from the command line)

Like you, often I mostly crop to the same aspect ratio. I'll pick 3:2 to match photo paper. Doing a 2:3 crop is essentially the same for this purpose; needing to push another button would be annoying.

I don't know why you get the idea that gimp would spaz out between portrait and
landscape. That would only happen if you went at just about exactly a 45-degree angle. Of course there is no reason to do this. The problem is no different then what happens if you move at a 0-degree angle under your proposed system... unless you also want to enforce that a selection always moves from upper-left to lower-right or you add 4 buttons to specify selection direction.


Comment 25 Michael Schumacher 2007-02-11 14:23:05 UTC
*** Bug 406542 has been marked as a duplicate of this bug. ***
Comment 26 Bruno Duyé 2007-09-24 22:17:46 UTC
 There is a very interesting UI concerning defaults aspects in gthumb.

 Just to say

Thanks to all
Bruno Duyé
Comment 27 Martin Nordholts 2007-09-25 06:27:34 UTC
The gThumb solution is indeed interesting, and should not be too complicated to implement. Let's look at this closer for 2.6.
Comment 28 Sven Neumann 2007-09-25 08:32:23 UTC
Could you please add a screenshot here then or describe the solution in gthumb? Without this information such comments are just noise.
Comment 29 Martin Nordholts 2008-05-28 18:06:29 UTC
Setting to Future, if this would have happened for 2.6 it would be me that fixed it, but I'd rather focus on other things.
Comment 30 Michael Schumacher 2008-12-05 13:10:54 UTC
*** Bug 563338 has been marked as a duplicate of this bug. ***
Comment 31 Michael Schumacher 2008-12-05 13:12:26 UTC
I guess that this should be available to all tools that offer a fixed ratio.
Comment 32 Michael Schumacher 2014-11-04 08:31:33 UTC
*** Bug 739249 has been marked as a duplicate of this bug. ***
Comment 33 Alexandre Prokoudine 2017-06-11 23:08:00 UTC
https://git.gnome.org/browse/gimp/commit/?id=36316e20b911b427065f4ef622d215ad700ca09f

Bug 156858 - Add option menu of standard aspect ratios to ratio-using tools

Add 4x3 Landscape/Portrait, 3x2 Landscape/Portrait, 16x10, 16x9, and Square presets