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

How do I search for square images in Lion?

I can't work out how to search for images where the image's width is equal to the height. This is regardless of the actual number of pixels.


Any tips would be appreciated?

Posted on Mar 29, 2012 3:09 AM

Reply
6 replies

Mar 29, 2012 4:10 AM in response to MichaelToye

Hello,


Maybe there's a plugin for Spolight but didn't find one after a quick search.

I would suggest to do like this :

- You can create a smart folder and you can to modify the with and height for each search.

To create it :

  1. In the Finder menubar choose File > New smart folder.
  2. Click on the + (near Save)
  3. A menu appears in the window. In the first choose Other...
  4. In the search bar write height and check the box for Pixel height then click on OK (when you ckeck the box it will appears each time in the menu where Other... is, so you don't have to do that each time)
  5. You will see Pixel height in the menu, now we will do the same for the width. Click on the + on the same line. A second menu appears in the window. Choose Other... in it.
  6. In the search bar write width and check the box for Pixel width then click on OK.
  7. You will have something like this in the window :
  8. User uploaded file
  9. If you want you can add a third setting by choosing Kind is Image (or whatever you want).
  10. Now you can click on Save to save that folder with those search fields and you can add it to the Sidebar too.
  11. Now you can specify the image's width and height and it will search all the files on your computer.
  12. Hope this will help 🙂


And for information if you save that folder in your sidebar and when on you click on it you don't see the search criteria just do a right-click on the folder and select Show Search Criteria in the menu that appears. Like my picture :

User uploaded file

Mar 29, 2012 6:56 AM in response to MichaelToye

Well, I solved this by writing an Applescript to rename square images with a searchable suffix.


try

tell application "Finder" to set the this_folder to (folder of the front window) as alias

on error

set the this_folder to path to desktop folder as alias

end try

tell application "Finder"

set selected_items to selection

set oldDelims to AppleScript's text item delimiters

set AppleScript's text item delimiters to ":"

repeat with aFile in selected_items


set img_ to quoted form of POSIX path of (aFile as text)


if the name extension of aFile is "JPG" then

set my_dimensions to (do shell script " sips -g pixelWidth " & img_)

set width_ to text item 2 of my_dimensions

set my_dimensions to (do shell script " sips -g pixelHeight " & img_)

set height_ to text item 2 of my_dimensions

if (width_ = height_) then

do shell script "mv " & img_ & " " & img_ & ".SQ.JPG"

end if

end if

end repeat

set AppleScript's text item delimiters to oldDelims

end tell

How do I search for square images in Lion?

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