Page 1 of 1

Sort images by landscape or square

Posted: Mon Sep 24, 2018 4:58 pm
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

Re: Sort images by landscape or square

Posted: Wed Sep 26, 2018 12:24 pm
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.