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

Features wanted...
Post Reply
Kyle
Posts: 10
Joined: 21 May 2022 00:42

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

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

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

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

Post by admin »

Good point. :tup: I have now fixed the sorting. The searching is harder. Later...

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

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

Post by admin »

Okay, looks like I managed to improve the searching and filtering as well. Next beta...

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

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

Post 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?

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

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

Post by admin »

Ah yes. Will all work in next beta. :tup:

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

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

Post by admin »

By the way, now we have the full range.
Attachments
2022-05-31_200036.png
2022-05-31_200036.png (104.42 KiB) Viewed 1754 times

Post Reply