Sort images by landscape or square

Post Reply
tarek.bettaieb
Newbie
Posts: 4
Joined: Mon Sep 24, 2018 4:52 pm

Sort images by landscape or square

Post by tarek.bettaieb »

Hello guys,

I need your help!

I'm trying to create a flow in Switch for images.

The idea is to sort images by landscape or square, and I'll made some rescale...

I tried with different script but no luck :( javascript, expression etc....

Any idea how to do this?

Thank you

Tarek
User avatar
Terkelsen
Advanced member
Posts: 298
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Sort images by landscape or square

Post by Terkelsen »

You don't need any scripting to sort the files. Use the Switch variables. An image will contain exif metadata. It will tell you the exif:PixelXDimension and exif:PixelYDimension. If exif:PixelYDimension is greater than exif:PixelXDimension the image is landscape. If it's the opposite it's portrait and if they are equal it's square.
Post Reply