0

I'm trying to resize new image files in a folder using a folder action so the files that were already resized to 300x250 don't get resized again. The thing is I'm having issues getting the resizing to happen at all..

Here is my current Automator Workflow: enter image description here

It works when I test it by adding "Get Selected Finder Items" but when I close automator and I add new files to the folder nothing happens. I'm using Hazel to move jpgs to the folder, but nothing is happening to the files after they are moved into the folder to be resized

3 Answers 3

1

As you already have Hazel installed anyway, it might be easier to use it to trigger the image resizing as well. Create a new rule in Hazel to watch the folder and execute the command:

enter image description here

1
  • I tried doing something like this with hazel but I couldnt figure it out.. do you have an idea how I would?
    – Joe Bobby
    Commented Oct 25, 2013 at 22:21
1

You'll have to run it in a loop, otherwise it won't work(as you may saw :) )

Run this instead

for f in "$@"
   do
     sips --resampleHeightWidth 250 300 "$f" 
   done

The step by step option provided by Automater is very helpful. Also, when testing use the "Ask for Finder Items" action including "Allowing Multiple Selection".

enter image description here

0

You could also use ImageMagick:

brew install imagemagick
for f in /path/to/mat/*; do
  if [[ $(identify -format %wx%h "$f") != 300x250 ]]; then
    convert "$f" -filter lanczos2 -resize 300x250 "$f"
  fi
done

sips and Automator (which use an identical resizing method) make images look fairly blurry if you don't add any sharpening. Below the image on the left side was resized with sips --resampleWidth 300 and the image on the right side was resized with convert -filter lanczos2 -resize 300x:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .