So I was previewing some photos using Preview app and I notice that Preview (at least on 10.10.5 Yosemite) 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.

1 Answer 1


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: recursive-autorotate-photos.sh path-here"

sample: # recursive-autorotate-photos.sh "/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. I always use double quotes now out of habit.

You must log in to answer this question.

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