Page 1 of 1

Sort and filter the "aspect ratio" special property by the quotient

Posted: 21 May 2022 01:11
by Kyle
Currently the "aspect ratio" special property appears to be sorting by the first number in the ratio and then the second number, with some odd behavior around numbers with decimal points. Using relational operators with this property in filters (e.g., prop:#AspectRatio: >= 2:1) doesn't do what you'd expect.

I think this property would be more useful if sorting and filtering used the quotient of the two numbers for comparison. This enables you to sort images from tallest to widest (e.g. 4:3, 3:2, 8:5, ...), or use a visual filter like prop:#AspectRatio: >= 2:1 for example to look at panoramas.

As a workaround, I use a script in a custom column to do this:

Code: Select all

$w = property('System.Image.HorizontalSize', <cc_item>);
$h = property('System.Image.VerticalSize', <cc_item>);
return format($w / $h, "0.00");
I can use a filter like cc16: >= 2.0 with my custom column. However, I've used other software which can sort images this way so I think it would be nice to have it working out of the box in XYplorer.

Re: Sort and filter the "aspect ratio" special property by the quotient

Posted: 24 May 2022 16:58
by admin
Good point. :tup: I have now fixed the sorting. The searching is harder. Later...

Re: Sort and filter the "aspect ratio" special property by the quotient

Posted: 24 May 2022 17:29
by admin
Okay, looks like I managed to improve the searching and filtering as well. Next beta...

Re: Sort and filter the "aspect ratio" special property by the quotient

Posted: 26 May 2022 03:40
by jupe
Just wanted to check something, I was testing this change and noticed that it doesn't apply (LF & QS) when using the alternate selectors, eg. AspectRatio: >= 2:1, Aspect Ratio: >= 2:1, is that correct?

Re: Sort and filter the "aspect ratio" special property by the quotient

Posted: 26 May 2022 14:47
by admin
Ah yes. Will all work in next beta. :tup:

Re: Sort and filter the "aspect ratio" special property by the quotient

Posted: 31 May 2022 20:02
by admin
By the way, now we have the full range.