how to create a custom column that sort based on images orientation?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
ucok66
Posts: 3
Joined: 20 Nov 2019 12:57

how to create a custom column that sort based on images orientation?

Post by ucok66 »

Hai, I am curious if there is a way to make a custom column that can sort images based on orientation (portrait, square and landscape).

I already read a topic made by mkolaski viewtopic.php?f=3&t=14504&p=127568, but I still don't know what to do

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: how to create a custom column that sort based on images orientation?

Post by highend »

By scripting it...

Code: Select all

    $dimensions = property("dimensions", <cc_item>);
    if (!$dimensions) { return ""; }
    $width  = gettoken($dimensions, 1, " x ");
    $height = gettoken($dimensions, 2, " x ");
    if     ($width == $height) { return "square";    }
    elseif ($width > $height)  { return "landscape"; }
    else                       { return "portrait";  }
cc.png
To see the attached files, you need to log into the forum.
One of my scripts helped you out? Please donate via Paypal

ucok66
Posts: 3
Joined: 20 Nov 2019 12:57

Re: how to create a custom column that sort based on images orientation?

Post by ucok66 »

Thank you, this is helpful

Post Reply