On 10 September 2010 01:13, Mattias Põldaru <[email protected]> wrote:
> JPG files can contain EXIF data, which specifies it's orientation. This
> is good, because JPEG is lossy format and every time you reencode it,
> you loose some information. Doing real rotate in file is not possible
> without reencoding.
> The problem is, not all software can handle EXIF rotate right. But GIMP
> can, it asks on opening, whether to rotate the image or not (since it
> has to reencode it anyway).

Apparently this isn't so. jpegtran (in package libjpeg-progs in
Ubuntu/Debian) has a lossless rotator (plus a few other functions).

From the man page.

       jpegtran  works  by rearranging the compressed data (DCT coefficients),
       without ever fully decoding the image.  Therefore, its  transformations
       are  lossless: there is no image degradation at all, which would not be
       true if you used djpeg followed by cjpeg to accomplish the same conver‐
       sion.   But by the same token, jpegtran cannot perform lossy operations
       such as changing the image quality.

More information should be at http://jpegclub.org/
I believe not every JPEG can be rotated in this fasion, but a good
number can be.

Personally, I prefer if the camera ether rotates it, or the final
viewing software rotates it. But maybe an option at import time to
rotate images would be good? My old camera import script would run all
my photos through exiftran which does the same lossless rotations as
jpegtran but also updates the exif information to reflect the rotation
(and got the rotation direction from the exif).
http://linux.bytesex.org/fbida/ for exiftran

Tim

-- 
Timothy White - Somewhere in Australia
_______________________________________________
Shotwell mailing list
[email protected]
http://lists.yorba.org/cgi-bin/mailman/listinfo/shotwell

Reply via email to