Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Lossless rotation of JPG images and thumbnails Apps
I have been very frustrated by OS X's (Preview app) handling of image rotation. You can, of course, have Preview rewrite the EXIF tag and make the image appear rotated, but as soon as you go to put that image on the web or use it in Word, etc, that rotation simply doesn't exist. What's more, even after you apply new icons to a file (i.e. using CocoThumbX), the icons might not show up correctly.

Until now, I used a combination of Preview (to modify the EXIF orientation value) and PhotoToolCM (to do lossless JPG rotations) to achieve images that look correct both in Preview and in non-EXIF/web apps. Well, I finally found a program that both rotates the image and the thumbnail consistently! Enter the freeware Cheese by Stuffware.co.uk. This is a bare-bones program that has two basic purposes: rotate pictures properly, and allow you to add comments easily (it can also create web pages from your images).

Once you've rotated your pictures, here's a fast way to get your thumbnail icons to show correctly (i.e. refresh):
  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.
Done! Your images will now show their "true" thumbnails.
    •    
  • Currently 2.50 / 5
  You rated: 3 / 5 (6 votes cast)
 
[25,270 views]  

Lossless rotation of JPG images and thumbnails | 10 comments | Create New Account
Click here to return to the 'Lossless rotation of JPG images and thumbnails' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Lossless rotation of JPG images and thumbnails
Authored by: jwz on Apr 25, '08 11:39:00AM
If you're looking for a cross-platform, command-line way to losslessly rotate jpegs and their thumbnails, there's my "rotimg" perl script: http://www.jwz.org/hacks/rotimg

[ Reply to This | # ]
Lossless rotation of JPG images and thumbnails
Authored by: leamanc on Apr 25, '08 06:20:26PM
I tried your script out and it threw up a whole slew of errors, but started with this:
Can't locate Image/ExifTool.pm
This is Intel 10.5.2 with Developer Tools installed. Should something else be installed to make this work?

[ Reply to This | # ]
Lossless rotation of JPG images and thumbnails
Authored by: MtnBiker on Oct 28, '09 09:51:28PM

I know almost nothing about Perl but you might try adding this as the second line to the script:

BEGIN { unshift @INC, "/usr/bin/lib/" }

You may need to install EXIF Tools http://www.sno.phy.queensu.ca/~phil/exiftool/

I have a script that worked in Leopard and it quit working in Snow Leopard. I suspect some things have moved. I found the missing files in the location in the added line. And based on some answers to similar problem found via Google.

---
Hermosa Beach, CA USA



[ Reply to This | # ]
There's also Xee
Authored by: Lectrick on Apr 25, '08 11:49:13AM
Xee has done lossless jpg rotation for some time now. The relevant features are pasted here:

• Losslessy rotate and crop JPEG images. This lets you edit your digital photographs without losing quality by re-compressing them like most other editors do.
• View more EXIF data for JPEG files than Preview.

---
In /dev/null, no one can hear you scream

[ Reply to This | # ]

Lossless rotation of JPG images and thumbnails
Authored by: larsskovgaard on Apr 25, '08 01:35:00PM

Preview is actually able to apply the rotation correctly. The key is to use File > Save As... and uncheck the checkbox named something like "Use EXIF direction" (I'm not sure of the precise text since my system is using danish as the main language).



[ Reply to This | # ]
Lossless rotation of JPG images and thumbnails
Authored by: PCheese on Apr 25, '08 02:39:52PM

"Use EXIF Orientation Tag" here.



[ Reply to This | # ]
Lossless rotation of JPG images and thumbnails
Authored by: barefootguru on Apr 25, '08 02:21:08PM

The omnipresent GraphicConverter also does lossless JPEG rotation.



[ Reply to This | # ]
Lossless rotation of JPG images and thumbnails
Authored by: chiensavant on Apr 29, '08 12:22:27AM
I'd rather use an easier way to rotate images, without the need to download an extra freeware. Open Terminal and simply enter the following command :

sips -r 90 (press space) drag and drop your image (whatever format) to the terminal window and press Enter

The end result should look something like this : sips -r 90 /Users/youraccount/Desktop/Image 1.png

This will rotate the image 90 clockwise. Do do the opposite, enter 270 instead. It only turns CW, so you have to do the math...

You can see all related options of sips by entering sips --help in the Terminal.

[ Reply to This | # ]

Lossless rotation of JPG images and thumbnails
Authored by: chiensavant on Apr 29, '08 12:38:41AM
By the way you can do the same with a batch of images by simply applying the rotation to all images contained in a folder. The command is the following :

sips -r 90 (drag and drop your folder to the Terminal, remove the ending space) /*.png

The end result should be pretty similar to this : sips -r 90 /Users/youraccount/Desktop/Folder/*.png

sips can convert jpeg (Jfif & Xiff), TIFF, GIF, PNG according to this Apple technical note. I haven't tested them all ;)

[ Reply to This | # ]

Lossless rotation of JPG images and thumbnails
Authored by: samrod on Jun 07, '08 06:24:00PM

How do you know sips is lossless? I haven't found that mentioned anywhere in Apple's Technote, the sips man page, or even its Image Events AppleScript interface.

I just created an Automator Workflow to rotate an image using sips on the command line, and it changes file sizes after rotation. It doesn't seem to be lossless at all.

Correct me if I'm wrong.
samrod



[ Reply to This | # ]