Page 1 of 1

Creating a Custom Column that sorts by Dimension total?

Posted: 22 Dec 2019 21:07
by kluv
I would like to keep all my images that the WxL is 1000x1000 or more. However, some of the images that are, let's say 899x1350 are also big enough, whereas 865x1082 is not.

Is there a script or way to create a column that shows the total value of WxL?
i.e.
1000x1000= 1,000,000 :appl:
865x1082= 935,930 :naughty:

Thank you,

Re: Creating a Custom Column that sorts by Dimension total?

Posted: 22 Dec 2019 21:16
by highend
return property('System.Image.HorizontalSize', <cc_item>) * property('System.Image.VerticalSize', <cc_item>);

Re: Creating a Custom Column that sorts by Dimension total?

Posted: 23 Dec 2019 00:51
by kluv
highend wrote: ↑22 Dec 2019 21:16 return property('System.Image.HorizontalSize', <cc_item>) * property('System.Image.VerticalSize', <cc_item>);
Thank you!! I do alot of searches on here and usually you are the one providing the answers. I hope they are all hooking you up on Paypal. Thanks again. :beer:

Re: Creating a Custom Column that sorts by Dimension total?

Posted: 23 Dec 2019 10:05
by highend
Thanks for the donation :tup:

Maybe something like this would be an option as well (it's easier to see if it's larger or smaller than 1.000.000):

Code: Select all

$dimensions = property('System.Image.HorizontalSize', <cc_item>) * property('System.Image.VerticalSize', <cc_item>);
    if ($dimensions >= 1000000) {
        return "> [$dimensions]";
    } else {
        return "< [$dimensions]";
    }