Automator action "Rotate Images" is incredibly memory-intensive
Here is the some applescript code I wrote to rotate an image right 90.  You may only rotate right. So if you want to rotate left 90 to enter you will have to rotate right 270.

(* 
  Demonstration of how dropping files on AppleScript icon works.  Shows how to debug via on run path. Shows items added to folder.

 Save as an Application Bundle.  Don't check anything.

 Shows log statement.

 It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.

For testing, run in the Script Editor.
    1) Click on the Event Log tab to see the output from the log statement
    2) Click on Run


Author: rccharles

 *)


-- Gets invoked here when you run in AppleScript editor.

on run
    --  debug lines
    set desktopPath to (path to desktop) as string

    -- here is a log statment.
    log "desktopPath = " &amp; desktopPath

    -- Be sure to select a file on your DESKTOP.
    set see to alias (desktopPath &amp; "picture.jpg")

    -- Simulate dropped items list.
    set dropped_items to {see}

    common(dropped_items)

end run



-- Gets invoked here when something is dropped on the folder
-- Folder actions.

on adding folder items to this_folder after receiving added_items


    common(added_items)

end adding folder items to



-- Gets invoked here when something is dropped on this AppleScript icon

on open dropped_items
    display dialog "Number of items dropped is " &amp; (count of dropped_items) &amp; ". " giving up after 3

    common(dropped_items)

    display dialog "Processed " &amp; (count of dropped_items) &amp; " items. " giving up after 2

end open



on common(dropped_items)

    -- Write a message into the event log.
    log "  --- Starting on " &amp; ((current date) as string) &amp; " --- "


    log "class = " &amp; class of dropped_items


    repeat with droppedItem in dropped_items

        -- display dialog "here is something that we got as input: " &amp; droppedItem giving up after 2
        set unixDroppedPath to POSIX path of droppedItem
        log "unixDroppedPath = " &amp; unixDroppedPath

        set quotedUnixDroppedPath to quoted form of unixDroppedPath
        log "quoted form is " &amp; quotedUnixDroppedPath

        try
            set fromUnix to do shell script "sips -r 90  " &amp; quotedUnixDroppedPath
            -- display dialog "sips -r 90 of " &amp; quotedUnixDroppedPath &amp; return &amp; " unix says " &amp; fromUnix giving up after 1
        on error errMsg
            log "sips -r 90  error..." &amp; errMsg
            display dialog "error from sips -r 90 of " &amp; errMsg
        end try

    end repeat


end common


insert a preview rotated image.



insert a sips rotated image.