Apple Intelligence now features Image Playground, Genmoji, Writing Tools enhancements, seamless support for ChatGPT, and visual intelligence.

Apple Intelligence has also begun language expansion with localized English support for Australia, Canada, Ireland, New Zealand, South Africa, and the U.K. Learn more >

You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I sort folder of jpegs by orientation?

I need to resize 10,000+ jpegs to a square format. I have set up separate Photoshop Action Scripts for the images that are Landscape orientation and Portrait orientation.


My question:


Is there a way to select only the portrait or landscape oriented photos so that I can place them in seperate folders to run the appropriate Photoshop script?


I have tried cmd-F > with a search attribute of 'Orientation' but that didn't give me the expected options.

Mac Pro, Mac OS X (10.6.8)

Posted on Nov 10, 2011 12:07 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 10, 2011 1:28 PM

I have tried cmd-F > with a search attribute of 'Orientation' but that didn't give me the expected options.


Try settiing "Orientation equals 1" to find the portraits and "Orientation equals 0" to find the landscapes.

10 replies

Nov 10, 2011 2:08 PM in response to fordjoe

With the folder open and active, set it to Icon view, then press Command-J - that will open View Options for that window. In the View Options window checkmark the item "Show Item Information". This will add the dimensions for the image underneath its name in the folder's window. You can use that info to determine its orientation.


I realize this works best for a modest amount of images; a folder with several thousand can be inconvenient to parse this way. On the other hand, if the extra info is considered to be part of the filename, it may make using a script easier (if x is larger than y, etc.).

Nov 10, 2011 2:46 PM in response to fordjoe

Glad it worked!


Actually I had never heard of this before now.

What I did know is that the Terminal command mdls will return a list of a file's metadata attributes that are indexed by Spotlight. When I used this command on a portrait photo file, the list of metadata attributes included

kMDItemOrientation = 1

and when I used mdls on a landscape photo, that attribute was reported as

kMDItemOrientation = 0

How do I sort folder of jpegs by orientation?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.