Standard application to automatically rotate pictures based on EXIF

Solution 1:

jhead + jpegtrans

Use jhead (which requires jpegtran for the auto-rotation feature).

From the windows shell,

jhead.exe -autorot image.JPG

For a batch of pictures in a directory, use shell globbing, e.g.

jhead.exe -autorot pics\*.JPG`

jhead will not modify files that do not need rotation.


Additionally

Make sure jheadtran.exe is in the environment PATH, e.g. PATH=%PATH%;C:\Path\to\jpegtran.

I suggest the -ft flag to "Set file modification time to Exif time".

Solution 2:

Windows 7 has PowerShell installed by default, which can be used to script image editing thru either WIA (Windows Image Aquisition) or the .Net system drawing object. Here's a quick powershell script using the .Net method to rotate all the jpg's found in the current directory by 90 degrees clockwise.

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
dir *.jpg |
ForEach-Object {
  $image = [System.Drawing.image]::FromFile( $_ )
  $image.rotateflip("Rotate90FlipNone")
  $image.save($_)
}

Rotation is limited by 90 degree increments, including image flipping orientation.