Some digital cameras can record the orientation of the camera when the photo is taken. This is recoded in the images exif data. The images can be rotated 90°, 180°, 270°, or none if the picture is OK.
This will not work on all digital cameras
- Using JPEG-EXIF autorotate in Windows Explorer, to automatically rotate by right clicking the folder containing the photos
- Using ABC-View Manager to rotate images
- Using f-spot to rotate images
- Using Rasco Resizer
- It allows user to automatically rotate pictures based on EXIF data, rotate and watermark.
The standard jpeg library includes two programs, jpegexiforient and jpegtran. A shell script named exifautotran uses these programs to read Exif data labeled Orientation and automatically rotates the image to the proper orientation — 90°, 180°, 270°, or none.
Most Unixes, such as Linux, have the jpeg library installed by default, but if yours doesn't:
- Download jpegsrc-*.tar.gz, compile and install, or install it using your favorite package manager
- See if your jpeg package includes exifautotran. If it doesn't, get the code, save it to your hard drive, and make it executable with chmod 755 exifautotran.
- To rotate a single image, execute:
- exifautotran image_name
- To rotate all images in a directory automatically, execute:
- exifautotran *
See http://jpegclub.org/exif_orientation.html for details
Note: The exifautotran script uses the command jpegexiforient to figure out the orientation stored in the Exif label of a file. However, it may fail to read JPEG files storing JFIF standard 1.01 information. Reading such files can be performed manually using the exiftool utility.
For example, the following command will retrieve orientation information from a JFIF file:
exiftool -t -s -n -IFD0:Orientation -IFD1:Orientation
And to set the orientation in both IFD0 and IFD1 tags to default (no rotation), use:
exiftool -n -IFD0:Orientation=1 -IFD1:Orientation=1