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
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 ID.