Many cameras take note of their orientation when a photo is taken. This information is embedded into the JPG image as exif data (think “meta data”). This tells applications that they should rotate the image a certain amount before displaying it. It’s a great feature — for applications that support it. OS X’s Preview application supports it in 10.4, but all web browsers I have tried do not. Flickr supports auto-rotation (if you enable it), but it doesn’t auto-rotate your original image… that’ll be stuck sideways.
What I needed was a quick way to losslessly rotate the actual images, based on the exif rotation flag. A quick search didn’t reveal anything that only did that, and it’s more fun to roll your own, so that’s what I did.
Go here to download my solution.
The muscle is provided by the public domain program jhead, which in turn uses the public domain program jpegtran. The Apple-friendly layer is provided by Automator. After installation (sorry, you’ll have to muck around manually), you’ll be able to simply drop your exif-rotated JPG images onto an application and they’ll automatically be rotated according to the exif rotation flag and then have their rotation flag set to the “no rotation” setting. The Automator script takes care to only touch JPG files, so if you have a folder with a mix of JPG and RAW files (JPG+RAW modes rock), you can select everything and drop it without worries.
For Unix geeks, this is the command being run: jhead -autorot image.jpg
This isn’t anything revolutionary, but it solves an annoyance I was experiencing, so I thought I’d pass it along.
Thanks to my wonderful girlfriend-with-a-rock (we loathe the f-word) Sarah, whose annoyance at my un-rotated Flickr photos prompted me to do something about the matter.
Sar says
Aw, you’re welcome. I’m glad my intolerance of almost everything has finally contributed something positive to the world. Or a small subset of people. Whatever.
Basil Crow says
Your instructions include copying a binary to /bin. While it works, binaries like that belong in /usr/bin, and if they’re installed manually, it’s probably better to put them in /usr/local.
Roy says
Just to say thank you for this. It was enormously helpful. Perhaps one day this could be added as a simple option to a number of apps (e.g. GraphicConverter or Photoshop). It fills a needed gap. I could not find this mentioned on any photo site, it might be worth mentioning somewhere appropriate. Not sure where though.
Thanks Again (to Sar also!).
Jason says
This is exactly what I was looking for. Why was it so hard to find! Thanks for posting.
Michael Keel says
Thanks for your work on this, I have been looking for an elegant solution like this for a couple years.
Unfortunately I am unfamiliar with Unix and need the simplest help in placing the programs in the folders in the usr/directory…How do I do that? Sorry to be such a simpleton. Excuse me.
I am on a G5 Mac OS X.
ivarvg says
Hi My Name Is ivawhc.
mariel says
thank you! thank you! thank you!
Keith says
Great utility! I was wondering why the thumbnails in Finder (icon view) sometimes rotate, and sometimes do not. It would be helpful to have the small thumbnails rotated as well.
Matias says
I was using a JPEG Lossless rotation action for automator, I came with GraphicConverter and it worked great until I upgraded to Leopard and it doesn’t work anymore. I was looking for a simple “right click” Jpeg Lossless rotation app and I think I have found it. Thanks!! but I have a problem…I have no idea about how to install the app. Please HELP!
Robert says
Mmmm, link to solution does not seem to work anymore…
Any chance of a fix?