Lightroom: I can't add (certain) custom crop ratios

  • 17
  • Question
  • Updated 1 month ago
  • Answered
  • (Edited)
I'm trying to setup a custom crop ratio, very close to a standard one. Lightroom uses instead a standard (predefined) crop.E.g.: I setup a 15.2 x 10.2 crop ratio, LR (5.5) uses instead 3 x 2 (rounded to nearest standard crop ratio)Please, correct the bug or find a better implementation (e.g. use Alt+click to enforce any custom ratio)

[The official reply below provides an incorrect technical analysis of this bug. See this reply for details of the bug's cause and a simple fix:
https://feedback.photoshop.com/photoshop_family/topics/i_cant_add_certain_custom_crop_ratios_in_ligh...]
Photo of Ciprian Trofin

Ciprian Trofin

  • 2 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 17
Photo of Steve Sprengel

Steve Sprengel, Champion

  • 2656 Posts
  • 341 Reply Likes
I agree.

3/2 = 1.500000000
15.2/10.2 = 1.4901960784...

Looks like they are rounding the decimal ratio to 2 significant digits which seems like too few significant digits when dealing with images that are 1000s of pixels in dimension and would result in the cropped image being off by dozens of pixels:

3:2 = 6000x4000
15.2:10.2 = 6000x4026 or 5961x4000

It doesn't matter if you enter the ratio as whole numbers, like 152x102 or 76x51, it still chooses 3x2.
Photo of Ciprian Trofin

Ciprian Trofin

  • 2 Posts
  • 0 Reply Likes
Older LR versions (I tested v3) does not exhibit this issue.
Photo of Euan Ramsay

Euan Ramsay

  • 7 Posts
  • 1 Reply Like
I have the same problem.

This problem on started to occur in updates after Lightroom 5.2

I have tried the latest 5.7 update and the problem still exists.

I need to use the exact crop 2600x3380 which any version after 5.2 will not allow. It rounds it up to 8.5x11 which is not the same crop.
Photo of Rikk Flohr

Rikk Flohr, Official Rep

  • 4253 Posts
  • 809 Reply Likes
This problem has been reported.
Photo of Euan Ramsay

Euan Ramsay

  • 7 Posts
  • 1 Reply Like
Will this problem be resolved?
Photo of Iustin Pop

Iustin Pop

  • 8 Posts
  • 0 Reply Likes
Indeed, can we have an update? It's been one year...
Photo of Ralf Longwitz

Ralf Longwitz

  • 8 Posts
  • 2 Reply Likes
Update, please
Photo of Mark Treen

Mark Treen

  • 5 Posts
  • 8 Reply Likes
I just want people who make these decisions to modify software to understand it's impact.
I get paid to take pictures. Sometimes the pictures need to be an exact pixel dimension.

Last year I delivered a 161x130 profile pic for a website to a client.
Last week I delivered a 161x129 pix image to a client without knowing an update changed this feature. Now I have to erode their confidence in me and communicate the issue. I can't blame Adobe software engineers when I talk to my client. These people aren't going to even understand what went wrong. It's a small thing but if I'm hired to deliver a specific photo I take it serious I deliver exactly what I'm asked to and I expect LR to be my one stop shopping when it's a single layer photo project.

Please address this bug quickly and don't make further changes that effect the final outcome of the actual photo.

I'm a huge Lr fan. I open in the morning and work 90% in it all day long. I get paid to teach it.
I need it to work correctly.
Photo of Euan Ramsay

Euan Ramsay

  • 7 Posts
  • 1 Reply Like
I agree!

My regular client requires images 2600x3380 pixels and I cannot use this ratio anymore. It may seem like a small problem but it is a huge one for a professional photographer who wants to deliver what the client needs.

I also use Lightroom every day and it my main photo work flow program.

I just downloaded the latest Lightroom CC 2015 and the issue has still not been resolved.
Photo of Michal Grubka

Michal Grubka

  • 1 Post
  • 0 Reply Likes
my lightroom freezes when I click "enter custom..."
is there any fix for this?
Photo of Rikk Flohr

Rikk Flohr, Official Rep

  • 3540 Posts
  • 643 Reply Likes
A preference file reset might take care of your freeze when clicking Enter Custom...
http://www.lightroomforums.net/showth...
Photo of Euan Ramsay

Euan Ramsay

  • 7 Posts
  • 1 Reply Like
I think we have been living with this issue for too long Adobe, as a professional photographer I need professional software.
Photo of Euan Ramsay

Euan Ramsay

  • 7 Posts
  • 1 Reply Like
This reply was created from a merged topic originally titled Custom Crop ratio bug after Lightroom 5.2 still not resolved.

The problem lies with custom crop ratios. I do regular work for a company who require the images in 2600x3880 pixels, or 2.6x3.88 ratio. In Adobe Lightroom 5.2 I was able to use this ratio. But all updates since 5.2 automatically change this ratio to 8.5x11, which is not the same ratio. It is impossible to use 2.6x3.88 as a custom ratio. I recently downloaded the latest Lightroom CC version and again this issue has not been resolved.
Photo of Jim Garrison

Jim Garrison

  • 15 Posts
  • 1 Reply Like
Same here. I need 13x10 (exactly) and Lightroom is converting this to 11x8.5, which is close but NOT the same thing.  You'd think since this topic is 2 years old Adobe would have had time to fix this by now.
Photo of Simon Chen

Simon Chen, Principal Computer Scientist

  • 1486 Posts
  • 469 Reply Likes
Official Response
Lightroom matches the aspect ratio of the current crop against the existing entries in the aspect ratio popup -- so that the matching aspect ratio entry can be automatically selected. This matching needs to account for some numeric rounding errors (imprecision) involved. For example when the crop is rotated, because the result image dimensions can only be expressed as integers, there will be quantization errors that will lead to inexact aspect ratio computation. The aspect ratio will not match exactly any of the existing aspect ratios in the popup (the magnitude of the rounding errors depends on the rotation angle and the cropped image dimensions). Lightroom has to provide allowance for the rounding errors. Otherwise when you rotate the crop, the aspect ratio would bounce between two aspect ratio entries (known or custom). That is not very intuitive and has been reported previously as a different bug.

So there is a tradeoff to set such a threshold for the rounding errors. It cannot be too tight and it cannot be too loose. Lightroom currently set the rounding threshold as 0.005. And in the case of 13 x 11 aspect ratio, ( 8.5/11 - 10/13 ) = 0.0035, which is less than the preset threshold 0.005. Thus it is considered the two aspect ratio to be the same.

The current behavior is as designed.
(Edited)
Photo of Ralf Longwitz

Ralf Longwitz

  • 8 Posts
  • 2 Reply Likes
No one here has even mentioned rotation here. If there is an issue with rotation, then fix it there. But do not stop everyone to set their images to the pixel size that they need. If you have to, then make the behaviour optional.  I do need to have exact pixel sizes, like many others. To have to use additional software just to crop by a couple of pixels is ridiculous.
Photo of Jim Garrison

Jim Garrison

  • 15 Posts
  • 1 Reply Like
Sorry, I also have 6.5.1 (standalone) installed and it will not accept 13x10, it just switches to 81⁄2x11.  See screenshots:


Photo of Simon Chen

Simon Chen, Principal Computer Scientist

  • 1486 Posts
  • 469 Reply Likes
Sorry. I typed in the wrong number in my Lr 6.5.1 UI (My finger slipped and I typed 13x11 instead). Looking at the actual math in the code, it computes ( 8.5/11 - 10/13 ) = 0.0035, which is less than the preset threshold 0.005. Thus it is considered the two aspect ratio to be the same.
Photo of Robert Somrak

Robert Somrak, Champion

  • 169 Posts
  • 44 Reply Likes
It would be great if the threshold could be changed to something smaller as suggested by John Ellis in a previous post on this thread.  The present .005 seems to be a little too extreme.  As John indicated it should be an easy change to make if the code John has listed is the code that is in Lightroom now.  
Photo of Ralf Longwitz

Ralf Longwitz

  • 8 Posts
  • 2 Reply Likes
To have a fixed threshold makes little sense. It should depend on the number of pixels. A 16px square favicon is not the same as a 20MP photograph. .005 seems rather arbitrary.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3857 Posts
  • 1013 Reply Likes
Since it is working as designed, I changed this from "Problem" to "Idea". 
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
I'd still call it a bug.
Photo of Ralf Longwitz

Ralf Longwitz

  • 8 Posts
  • 2 Reply Likes
Yep, still a problem, years later.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3857 Posts
  • 1013 Reply Likes
Simon Chen wrote, "For example when the crop is rotated, because the result image dimensions can only be expressed as integers, there will be quantization errors that will lead to inexact aspect ratio computation." [Emphasis added] 
 
That is the source of the problem.  LR is rounding the dimensions to the nearest pixel before finding a matching ratio preset.  It should not do this.  To understand why, let’s step back. 
 
I think everyone can agree on a basic invariant: Any exported pic should have the same aspect ratio as that displayed by the crop tool, to within half a pixel. For example, if I use the crop tool to crop a 3000 x 4000 pic to 8.5 x 11, the crop tool will display 8.5 x 11 and the exported pic will be 3000 x 3882  (3000 * 11 / 8.5 ~ 3882.35). 
 
But LR doesn’t always maintain this invariant.  Sometimes the exported pic has dimensions that differ by much more than half a pixel from the dimensions implied by the crop tool’s aspect ratio. 
 
For example, I took a large TIFF sized 20,000 x 13,333.  Using the crop tool, I adjusted the crop to be 17,279 x 13,333, a ratio of approximately 8.488 x 11.  But the crop tool displayed a ratio of 8.5 x 11.  However, the exported pic was 17,279 x 13,333, a ratio of 8.488 x 11, not the 8.5 x 11 shown in the tool.  If the exported pic matched the displayed ratio of 8.5 x 11, it would have dimensions 17,254 x 13,333, a difference in width of 25 pixels. 
 
Whether you call this a “bug” or not is beside the point. LR isn’t obeying a simple invariant that everyone agrees is desirable, and this is causing problems for users. 
 
-----------

The fix should be straightforward but requires some detailed explanation.     

LR always stores the crop parameters as high-precision floating point numbers, and those stored parameters never get rounded to the nearest integer pixel.  You can easily prove this by using the SDK to retrieve the crop parameters CropLeft, CropRight, CropTop, CropBottom, and CropAngle. 
 
When LR displays the current cropped dimensions in the Metadata panel, it properly rounds the displayed numbers to the nearest pixel.  Similarly, when you export a cropped pic, LR must round to compute the pixel dimensions of the exported pic.  But the unrounded high-precision crop parameters remain stored in LR's develop settings.  Retaining the unrounded parameters is essential, since LR won't know the pixel dimensions of the exported pic until time of export, when the user picks an actual export size. 
 
To find a matching preset to display to the user, LR should compute the current aspect ratio using the stored high-precision crop parameters without rounding to the nearest integer, and it should compare that ratio with the ratios of the crop presets. The comparison will still need to use a tolerance, as with all floating-point computations, but given that Lua uses 64-bit floats, that tolerance can be much smaller than the 5e-3 currently used by LR. 
 
More precisely, when comparing a crop with a stored preset, according to Simon LR is currently doing: 
 
    abs (round (crop.h) / round (crop.w) - preset.h / preset.w) <= 5e-3 

Instead, it should do:    

    abs (crop.h / crop.w - preset.h / preset.w) <= tolerance 
 
where tolerance is 0.5 / 65,000 ~ 7.7e-6.   Two ratios that differ less than that will always produce identical-sized cropped exports, even at the largest possible export size of 65,000 pixels. Conversely, ratios that differ more than could produce different-sized cropped exports. 
 
That tolerance comfortably accommodates the accumulated 64-bit floating-point errors resulting from repeated rotation and resizing.   As an experiment, I used the crop tool to apply a locked crop ratio and then continually rotated the crop from -45 to +45 degrees and back and interspersed with resizing from tiny to large, continually for over a minute, much more than any user would likely ever do.  The accumulated error in the aspect ratio was 1.02e-6, an order of magnitude less than the smallest tolerance value that distinguishes the largest export by one pixel. 
 
I’ll be releasing a plugin soon that demonstrates this method for correctly displaying aspect ratios.          
                    
Photo of John R. Ellis

John R. Ellis, Champion

  • 3857 Posts
  • 1013 Reply Likes
I just released the Any Crop plugin, which lets you define aspect ratios that are very close but not identical to Lightroom's built-in ratios, avoiding the bug described here.  Any Crop also provides a number of other crop enhancements users have asked for.
Photo of Ralf Longwitz

Ralf Longwitz

  • 8 Posts
  • 2 Reply Likes
I just installed this, wonderful, thanks a lot! 
Photo of Ciprian Trofin

Ciprian Trofin

  • 2 Posts
  • 0 Reply Likes
Looks like 2015.6 fixes the bug.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3857 Posts
  • 1013 Reply Likes
"Looks like 2015.6 fixes the bug."

The problem is still there in my CC 2015.6 (Mac and Windows).  For example, in the crop tool, click the drop-down menu, select Enter Custom, and enter 10 x 13.  The crop tool will incorrectly show 8.5 x 11 as the current ratio, and if you export the photo, it will have an 8.5 x 11 ratio.   (10 / 13 = 0.769, 8.5 / 11 = 0.773)

What happens when you try that?
Photo of Ciprian Trofin

Ciprian Trofin

  • 2 Posts
  • 0 Reply Likes
Sorry, my bad. The ratio I tested with (15.2 x 10.2) was already in catalog.
Photo of Colin Thomas

Colin Thomas

  • 3 Posts
  • 0 Reply Likes
I have this problem too. Lightroom CANNOT output an image 2000px x 2600px, and this is the size that my  client requires. I have to spend time fixing the issue with a Photoshop action on batches of files. I'm going to try John Rellis's plug-in (see above) as a patch for this issue, but it seems like something that Adobe could EASILY fix.
Photo of Larry Colen

Larry Colen

  • 27 Posts
  • 6 Reply Likes
Lightroom is broken, I'm trying to get a 10x13" print on an 11x14 piece of wood with a 0.5" border. Lightroom keeps changing 10x13 to 8.5x11 which would leave an ugly border on the ends.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3857 Posts
  • 1013 Reply Likes
Unfortunately, the Official reply from Adobe on this topic gives an incorrect answer -- they've decided this misbehavior is inherent in the characteristics of computer numerical computation and there's nothing they can do. But my analysis shows the flaw in their thinking, and my Any Crop plugin (the only workaround to this bug) demonstrates my analysis is correct.  The bug fix entails only a few lines of code.