Quote:
I know jpegtran does it losslessly and it changes the file size. (I even rotated 90, then 270 degrees with it, converted that and the original to pnm and verified that the two resultant files were identical, despite that the input files were differently sized.) However, I also know that the MS thing tosses EXIF data when you rotate.


I think misunderstood my explanation, I probably wasn't clear enough. I wasn't suggesting that rotating losslessly kept the file size the same. If you take a jpeg and rotate it losslessly by 90 degrees from the original file, the file size will change.

What I was saying is that you can demonstrate that a lossless rotation has taken place by rotating through 90 degrees, saving the jpeg, loading the rotated jpeg, rotating it back through 90 degress and then saving it again. Do that a couple of times and if the file size at a particular rotation point doesn't change then you have lossless rotation going on.

It looks like the Windows Viewer partially trashes the EXIF data, which is wierd. It retains some of the basic data and tosses the rest (and appears to corrupt a few fields). Before rotation I have:

File: IMG_6427_old.JPG
File size: 1,458KB
Image Serial Number: 264-6427
Camera Model: Canon EOS 10D
Camera serial number: 0330201671
Firmware: Firmware Version 2.0.0
Owner: Andrew Norman [email protected]
Date/Time: 2006:02:01 21:43:03
Shutter speed: 2 sec
Aperture: 8
Exposure mode: Av
Exposure compensation: -1/2
Flash: Off
Metering mode: Evaluative
Drive mode: Single frame shooting
ISO: 100
Lens: 17 to 40mm
Focal length: 40mm
Subject distance: 0.280 m
AF mode: Manual focus
Image size: 2048 x 3072
Rotation: none
Image quality: Fine
White balance: Tungsten
Color space: sRGB
Saturation: Normal
Sharpness: Normal
Contrast: Normal
Tone: Normal
Custom Functions:
CFn 1: SET button function when shooting: Menu display
CFn 2: Shutter release w/o CF card: Not possible
CFn 8: RAW+JPEG mode: large, fine
CFn 9: Bracket sequence: -, 0, +, Auto cancel: Enable
CFn 11: Menu button display position: Previous

and after:

File: IMG_6427_end.JPG
File size: 1,477KB
Image Serial Number: 264-6427
Camera Model: Canon EOS 10D
Camera serial number: 0330201671
Date/Time: 2006:02:01 21:43:03
Shutter speed: 2 sec
Aperture: 8
Exposure mode: Auto
Exposure compensation: -1/2
Flash: Off
Metering mode: Center-weighted average
Drive mode: Single frame shooting
Self-timer: 65 secs
ISO: 100
AF mode: One-shot AF
Image size: 3072 x 2048
Image quality: Unknown
White balance: Auto
Color space: sRGB
Custom Functions:
Default settings

So it looks like it is fine for rotating, as long as you don't care about your EXIF data too much

I wouldn't let it near any of my photos...
_________________________
Remind me to change my signature to something more interesting someday