imagemagick Rotate Image

mogrify -rotate 90 file.jpg


convert -rotate 90 original_file.jpg new_file.jpg

(mogrify overwrites the original image file, whereas, convert writes to a different image file)

Empty triangles in the corners, left over from rotating the image, are filled with the background color (white if no color is specified).

mogrify -rotate 90 -background "#779DF2" file.jpg

Auto rotate based on EXIF meta-data

convert -auto-orient original_file.jpg new_file.jpg