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
how to create a custom column that sort based on images orientation?
-
ucok66
- Posts: 3
- Joined: 20 Nov 2019 12:57
-
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?
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"; }
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?
Thank you, this is helpful
XYplorer Beta Club