Skip to main content
Adobe Photoshop Family

2 Messages

 • 

250 Points

Wed, Jul 2, 2014 6:40 AM

Solved

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

[This bug is fixed in LR 8.1: 
https://feedback.photoshop.com/photoshop_family/topics/i_cant_add_certain_custom_crop_ratios_in_ligh...]

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...]

Responses

Official Solution

Employee

 • 

1.7K Messages

 • 

32.4K Points

5 years ago

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.

Principal Scientist, Adobe Lightroom

8 Messages

 • 

182 Points

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.

Champion

 • 

2.6K Messages

 • 

33.7K Points

6 years ago

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.

2 Messages

 • 

250 Points

6 years ago

Older LR versions (I tested v3) does not exhibit this issue.

7 Messages

 • 

162 Points

6 years ago

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.

Adobe Administrator

 • 

8.5K Messages

 • 

121.6K Points

6 years ago

This problem has been reported.
 Adobe Photography Products

Quality Engineering - Customer Advocacy

7 Messages

 • 

162 Points

Will this problem be resolved?

11 Messages

 • 

174 Points

Indeed, can we have an update? It's been one year...

8 Messages

 • 

182 Points

Update, please

5 Messages

 • 

280 Points

6 years ago

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.

7 Messages

 • 

162 Points

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.

1 Message

 • 

60 Points

6 years ago

my lightroom freezes when I click "enter custom..."
is there any fix for this?

Adobe Administrator

 • 

8.5K Messages

 • 

121.6K Points

A preference file reset might take care of your freeze when clicking Enter Custom...
http://www.lightroomforums.net/showth...
 Adobe Photography Products

Quality Engineering - Customer Advocacy

7 Messages

 • 

162 Points

5 years ago

I think we have been living with this issue for too long Adobe, as a professional photographer I need professional software.

7 Messages

 • 

162 Points

5 years ago

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.

19 Messages

 • 

372 Points

5 years ago

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.

19 Messages

 • 

372 Points

5 years ago

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


Employee

 • 

1.7K Messages

 • 

32.4K Points

5 years ago

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.

Principal Scientist, Adobe Lightroom

Champion

 • 

783 Messages

 • 

13.6K Points

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.  

8 Messages

 • 

182 Points

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.

Champion

 • 

5.3K Messages

 • 

95.3K Points

5 years ago

Since it is working as designed, I changed this from "Problem" to "Idea". 

15.1K Messages

 • 

195.8K Points

I'd still call it a bug.

8 Messages

 • 

182 Points

Yep, still a problem, years later.

Champion

 • 

5.3K Messages

 • 

95.3K Points

4 years ago

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.          
                    

Champion

 • 

5.3K Messages

 • 

95.3K Points

4 years ago

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.

8 Messages

 • 

182 Points

I just installed this, wonderful, thanks a lot!