Sort and filter the "aspect ratio" special property by the quotient
Posted: 21 May 2022 01:11
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.,
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
As a workaround, I use a script in a custom column to do this:
I can use a filter like
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");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.