Visual filter - orientation

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
mkolaski
Posts: 33
Joined: 16 Jul 2013 20:16
Location: UK

Visual filter - orientation

Post by mkolaski »

Hi

Is it possible to filter the view based on whether images are portrait or landscape orientation?

Thanks,
Mick

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

Re: Visual filter - orientation

Post by highend »

Afaik: No.

One "workaround". A report / folderreport combined with a paper folder. Although it's not live...
One of my scripts helped you out? Please donate via Paypal

mkolaski
Posts: 33
Joined: 16 Jul 2013 20:16
Location: UK

Re: Visual filter - orientation

Post by mkolaski »

Could you give me more details on how to achieve this please as I'm not really sure what would be involved.
Alternatively, is a "normal" search available that would find all portrait/landscape images or could it be achieved by scripting by checking if x is > y in pixel size?

Stef123

Re: Visual filter - orientation

Post by Stef123 »

You'd also have to check for exif-orientation, imo. Changing the orientation will not switch the physical x-y axes afaik.

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

Re: Visual filter - orientation

Post by highend »

Only by scripting...

Try this:

Code: Select all

    $files = report("{fullname}|{prop:dimensions}<crlf>", listpane(, , 1));

    $portrait = "";
    $landscape = "";
    foreach($file, $files, "<crlf>") {
        $path       = gettoken($file, 1, "|");
        $dimensions = gettoken($file, 2, "|");
        if !($dimensions) { continue; }
        $x = gettoken($dimensions, 1, " x ");
        $y = gettoken($dimensions, 2, " x ");
        if ($x >= $y)    { $landscape = $landscape . $path . "<crlf>"; }
        elseif ($x < $y) { $portrait  = $portrait . $path . "<crlf>";  }
    }
    $choice = popupmenu("Portrait images|Landscape images", , , , , 1);
    if ($choice == 1)     { paperfolder("Portrait images", $portrait, , "nl"); }
    elseif ($choice == 2) { paperfolder("Landscape images", $landscape, , "nl"); }
One of my scripts helped you out? Please donate via Paypal

mkolaski
Posts: 33
Joined: 16 Jul 2013 20:16
Location: UK

Re: Visual filter - orientation

Post by mkolaski »

Many thanks, that works perfectly

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

Re: Visual filter - orientation

Post by highend »

Made a small change so that the scripts only processes files, not folder (names)...
One of my scripts helped you out? Please donate via Paypal

Post Reply