简体   繁体   中英

Is there a way to filter iOS Shortcuts photos by aspect ratio?

Is there a way to filter iOS Shortcuts photos by aspect ratio?

I have a Shortcut that finds a random photo after the filter Favorite in the last 12 months is applied. I would like to only have vertically oriented photos but aspect ratio isn't an option. Width and Height are options but the filter doesn't appear to let me compare the two whereby the width is less than the height. Currently I'm using a hard coded less than width which won't work long term if photo resolutions change. 在此处输入图像描述

Had the exact same issue:

I worked around this by getting 1 photo result, then using 'Get details of images' to set height and width to variables and comparing them in an if statement. If height bigger than width, set photo as wallpaper and end shortcut.

Wrapped the whole thing, including "Find photos" in "Repeat 20x" so it will iterate until it finds a match.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM