Rotate iPhoto2 images without losing quality

Feb 04, '04 09:51:00AM

Contributed by: Anonymous

iPhoto lets you easily rotate pictures 90 degrees but it (at least iPhoto 2) will decompress and recompress the image, causing some image deterioration if the image is in JPEG format. The Indendepent JPEG Group's jpegtran command can be used to rotate JPEG images without losing any quality if the picture dimensions are multiple of the iMCU size (8 or 16 pixels usually). jpegtan is part of the libjpeg library, so you'll need to install that first. Use Fink (libjpeg 6b-6 package) or DarwinPorts (jpeg package) to get the program.

Next you'll need my rotate90r.applescript AppleScript. Use Script Editor to save it as an application somewhere. It is my first piece of AppleScript, so be kind to it. If you drop one or more pictures on its icon, it will rotate the images 90 degrees clockwise in place. The AppleScript is written assuming a Fink installation of jpegtran; if you used DarwinPorts, you'll need to modify the set trancmd line to match your installation.

Then launch iPhoto and open its Preferences. There is a field called "Opens in other:". Select the AppleScript application you just saved. If you also select the "Opens in other:" button, then a double click will rotate the selected picture. Or you can Control-click picture and select "Edit in external editor." iPhoto will save the original picture when you rotate it the first time, so you can use "Revert to Original" menu to undo rotation.

[robg adds: I haven't tested this hint, but I looked at the AppleScript, and there's clearly nothing malicious in there...]

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040124135036825