Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Rotate photos using exiftool and AppleScript Apps
I often have to rotate my photos to the proper orientation, because my camera doesn't have position sensor. I'd like to do this operation without loss of quality, so I discovered exiftool, which simply rewrites some exif tags. The exiftool itself is a command line application, so I've created a simple GUI in AppleScript. The script is follows: Save the script as an application and simply drag the image (it should also work for multiple images) on the app. You will be asked which side to rotate. It may happen that you will have to adjust to values in the script (8 and 6); these values work with my camera. I personally use the app as an external editor for iPhoto.
    •    
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[2,236 views]  

Rotate photos using exiftool and AppleScript | 6 comments | Create New Account
Click here to return to the 'Rotate photos using exiftool and AppleScript' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Rotate photos using exiftool and AppleScript
Authored by: mesa on Mon, Oct 26 2009 at 8:59AM PDT
You can also use jpegtran from the independent jpeg group (ijg.org). It can rotate the jpeg data without re-encoding it.

[ Reply to This | # ]
Rotate photos using exiftool and AppleScript
Authored by: Dr. T on Mon, Oct 26 2009 at 10:53AM PDT
Don't most modern graphics, photo editing, and image cataloging applications know how to rotate a JPEG image in 90 degree increments without altering the underlying JPEG data? Do we really need special scripts or applications to do this?

[ Reply to This | # ]
Rotate photos using exiftool and AppleScript
Authored by: robogobo on Mon, Oct 26 2009 at 1:43PM PDT
You would think so, but for example if you rotate an image in Preview and then upload it to a website, the rotation doesn't take (and it recompresses). Not sure how it's working, but I used to have to use an exif utility when rotating. Lately I've gone back to using photoshop, which also does recompress.

[ Reply to This | # ]
Rotate photos using exiftool and AppleScript
Authored by: Doc Drang on Mon, Oct 26 2009 at 9:56AM PDT

I had sort of the opposite problem; photos taken looking down on a subject often had their EXIF rotation tag set incorrectly because of how I was holding the camera just before turning it to look down. I wrote a shell script called "derotate" that used exiftool to fix the tag:

http://www.leancrew.com/all-this/2009/04/derotating-jpegs-with-exiftool/

My worry about rotating JPEGs in a graphics program is that the image will degrade because the JPEG compression is reapplied to the rotated image. The nice thing about exiftool is that you can look through the Perl code and see that it's affecting only the EXIF tags, not the image itself.

---
Doc Drang
http://www.leancrew.com/all-this


[ Reply to This | # ]
Rotate photos using exiftool and AppleScript
Authored by: Old Toad on Mon, Oct 26 2009 at 11:02AM PDT
Try the donationware image editor, Xee, which losslessly rotates image files.

[ Reply to This | # ]
Rotate photos using exiftool and AppleScript
Authored by: nperry on Mon, Oct 26 2009 at 12:11PM PDT
If you are using iPhoto the suggested jpegtran is better than exiftool.

At least with iPhoto'08 if the orientation flag is set on an image then iPhoto will generate an internal "edited" version with the image rotated, rather than simply display the original image rotated on-the-fly. While the original image is kept the internal one is also, doubling your disk usage.

Using jpegtran losslessly rotates the image data and iPhoto does not generate its internal "edited" version.

You can use jpegtran to rotate images whose orientation flags are correct (i.e. if the orientation flag indicates image is rotated the data can be rotated and the orientation flag set to indicate no rotation). This has the dual benefit of saving disk space in iPhoto and supporting those programs which don't understand the orientation flag.

[ Reply to This | # ]