Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know how to do it manually. Now I would like to automate that based on EXIF data. I already have exiftool installed, but looks like it can only read the data, but can not rotate the image.

There is a similar question on SU about Ubuntu. But I'm looking for possible solutions using OSX.

share|improve this question
    
This answer to your quoted question mentions XnView. In the meantime there ist also XnViewMP which is very similar, but runs also under MacOS. –  mpy Jan 6 '14 at 11:17

3 Answers 3

up vote 4 down vote accepted
+50

You can use nconvert, which is freeware (for private and educational use) and available for Win, Linux and Mac.

This tool can rotate JPEG images lossless according to the EXIF orientation tag:

nconvert -jpegtrans exif -o 'rotated_%.jpg' *.jpg

That command will batch convert all JPEG files in the current directory and prepending their names with rotated_. This is controlled by the -o option, refer to nconvert -help for more possibilities:

-o filename       : Output filename
   Use # to specify position of numeric enumerator
   Use % to specify source filename
   Use $ to specify full source pathname
   Use $$ to specify source folder name
share|improve this answer
    
Thank, mpy. Where should I place nconvert once downloaded and unpacked (so that it will be available by name only)? I've tried to moved it to Applications, but it didn't help. –  LA_ Jan 6 '14 at 18:43
    
@LA_ : Into some directory which is in your PATH (check the output of echo $PATH). Under linux a usual place is ~/bin, but I can't say anything about OSX, sorry. Under some circumstances you have to issue rehash (or start a new terminal) after moving an executable to another dir. –  mpy Jan 6 '14 at 18:56

You may use the free jhead (which itself uses jpegtran).

To fix a picture named "image.jpg" just type :

jhead -autorot image.jpg

To fix all JPGs having EXIF data in the current folder use :

jhead -autorot *.jpg

If once rotated the thumbnail icons do not show correctly, you could refresh them by :

  1. Create a new folder (keep the untitled name)
  2. Move the affected images into the folder
  3. Using Column View, move the images back into the original folder
  4. Delete the empty untitled folder
share|improve this answer
    
This is my favorite - I remembered jpegtran to have some trouble with stripping EXIF data. A must have before sending pictures over e-mail, which will be viewed with Chrome or other browser not respecting EXIF orientation! –  Tomasz Gandor Aug 4 '14 at 10:17

This is not a scripted solution. I like this way as it allows me to change another aspects of the photos in one step.

Possible simple solution is to use Google Picasa.

After adding pictures in, all photos are autorotated for displaying. If the picture should be autorotated in the file, it is enough to push the save button on the picture folder. This will save all pictures in the folder with corrected rotation. Picasa is available for OS X as well and runs in Linux under Wine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.