Image Auto Rotate based on EXIF

This is a simply powershell script to detect the orientation of a picture and rotate based on his EXIF value.

Download

PS : you need to install : http://www.imagemagick.org/

$files = get-childitem -Filter *.jpg
$pattern = ‘[a-zA-Z\-\.]’
foreach ($file in $files)
{
    $Orientation=identify -format “%[orientation]” $file
    echo “$file Orientation= $Orientation”
    If ($Orientation -ne “TopLeft”)
        {
        echo “To Rotate”
        mogrify -auto-orient $file
        }
}