auto rotate photos and save them afterwards (perhaps using preview?)

Discussion in 'Mac Apps and Mac App Store' started by mrjayviper, Jan 2, 2016.

  1. mrjayviper macrumors regular

    Jul 17, 2012
    So I was previewing some photos using Preview app and I notice that Preview (at least on Yosemite .5) automatically fixes rotation issues on the thumbnail on the left.

    e.g. photo is upside-down when viewing it but the thumbnail shows it the right-side up. On preview, I still have to go through each photo and manually rotate them to make the changes permanent.

    Do you know of any freebie app (or not so expensive) or perhaps using Preview? I want the app to ignore pics that's right-side up.

    Thank you
  2. mrjayviper thread starter macrumors regular

    Jul 17, 2012
    I came across a binary called "nconvert". I copied these to /usr/local/bin. I then created a simple recursive shell script to go through the folder and subfolders and convert any photo that needs converting.

    function recursion {
    if [ $(find . \( -iname "*jpeg" -or -iname "*jpg" \) -maxdepth 1 -type f | wc -l) -gt 0 ]; then
    echo "Processing $_fullpath"
    echo "Processing $_fullpath" > $HOME/logs/recursive-autorotate-photos.log
    nconvert -jpegtrans exif -overwrite *.jpg
    for _item in *; do
    if [ -d "$_item" ]; then
    (cd "$_item"; recursion)
    if [ ! -z "$1" ]; then
    if [ ! -d "$HOME/logs" ]; then
    mkdir "$HOME"/logs
    echo "" > $HOME/logs/recursive-autorotate-photos.log
    cd "$1"
    echo "Usage: path-here"
    sample: # "/Volumes/my-external-disk/photos"

    take note of the quotes in the path. if there's a space in the path, there you need to enclosed it in double quotes.

Share This Page