1:1 aspect ratio is not a square

Posting rules: It shouldn't need saying, but... play nice. Please keep your discussions civil. You can disagree, just don't be disagreeable. And, of course, all of the usual stuff like no spamming. Tex adds: I'll be rigorously enforcing this as we go along. We're probably going to be a small community in a little lifeboat, so we can't have members at each others' throats. This is for the sake of the project as a whole. So when you post, pretend you're speaking in person with your very wealthy auntie who has always treated you wonderfully and currently lists you prominently in her will. I won't be tossing anyone out of the forums because we are all in this together (except spammers: immediate membership cancelation), but I'll delete suspect posts right away.

10 posts / 0 new
Last post
1:1 aspect ratio is not a square



When I use 1:1 aspect ratio in cropping the resulting image is not a square. there is an error of 1 or 2 pixels. In my tests this happens only to images that are originally portrait. I have tested with both Canon raws (.CR2) and ready JPEGs. I can share test images if you need.




PS. I'm running LZ beta13 on Win7/64

Hi Juha,

Hi Juha,

Thanks for your report. I've just created an issue report: https://github.com/Aries85/LightZone/issues/135

I will fix this issue in next beta release.




Tested with my images and can confirm fixed.


Happy New Year to Masahiro & team


Bug still remairens



In some of my images this bug still haunts me. I have Canon 600D and when I have a portrait image, that I want to crop to square at full height, I get (sometimes) a converted JPG image that is 3456×3455. The error is only one pixel, but when my DAM can find all images that are square, this image doesn't match the search.




The source: https://dl.dropboxusercontent.com/u/48017639/IMG_6945.CR2

_lzn file: https://dl.dropboxusercontent.com/u/48017639/IMG_6945_lzn.jpg

Final JPG: https://dl.dropboxusercontent.com/u/48017639/IMG_6945.jpg

Additional info



There is an additional issue. The original image is 5202×3465 and when I crop i 1:1 (and press reset to get the full image) I get only 3456×3455 so it's 10 pixels less than the original. Is the resulting image scaled or cropped? The crop section in the lzn file is

      <UpperLeft X="827.0713344662342" Y="0.2726998592020209"/>
      <UpperRight X="4282.646573616177" Y="0.2726998592020209"/>
      <LowerLeft X="827.0713344662342" Y="3455.8479390091447"/>
      <LowerRight X="4282.646573616177" Y="3455.8479390091447"/>

Why the upper Y isn't 0.00 or the lower Y isn't 3465.00? The X difference is 3455.5752391499428 rounding to 3456 and the Y difference is 3455.5752391499426791 also rounding to 3456, but the converted image is only 3455 pixels high.



About raw file resolution

The declared resolution of your raw image (in metadata) is 5184x3456. Some programs, but not all of them, show this as image info. LightZone shows "Edit size" 5202×3465 for some reason.

Resolution of embedded preview jpg, extracted with ExifTool, is 5184x3456, that matches Canon's specifications for the camera.

After processing the CR2 file with different tools (without distortion corrections etc.), exported JPGs have slightly different sizes (or not):

LightZone: 5192x3455
RawTherapee: 5194x3457
darktable: 5198x3462
UFRaw 0.22: 5202x3465

The discrepancy depends on demosaicing algorithms. Nothing wrong here.

Have a nice day!

I didn't know that

Hi Mart,


Interesting, this was something I didn't know.


 But maybe because the maximum hight of JPG is 3455 pixels, there is this error of one pixel.




Juha, hi,

do you have a suggestion, how to find "almost square" images and, possibly, add a keyword to them? Could it be doable with ExifTool - or some completely different approach (and program)?

I also have quite many square images with 1-3 pixel difference between width and height, all made by LightZone. It is more or less a caprice, but I would still like to have a way to locate - and tag - them.

Thank you,


Two alternatives



I know you are using Daminion as DAM and I have two solutions based on that.


1) If you are using smaller lzn files (I have max 1024×1024, and they are always squares)

Search all images where "Image > Orientation" equals 3 and then find images where the corresponding JPG is missing


2) For all images

Clear all filters and select one image from your catalog. Select "Item > Export > Export to CSV ..." After selecting the file you have a possibility to export the selected image or all your images. Deselect all fields and select only Orientation, Width and Height and create the CSV file. Open the CSV file in Excel and add a formula to the first free column =AND(ABS(<width>-<height>) <= 3;<orientation> <> "Square") and fill the column down. Now all trues are images that differ 1–3 pixels from perfect squares.



Thak you, Juha,

very kind of you. I will try this tomorrow. Be well!



EDIT: Your formula works fine, also in Libre Office. Thanks again!