Is it possible via command line to rotate an image automatically so it is perfectly straight? For example, lets say I scan in a document and the scan is slightly at an angle because the document was not inserted into the scanner properly. I know you can rotate the image using something like this:
convert -rotate 90 input.jpg output.jpg
But is it possible to automatically detect how much it needs to be rotated by to straighten it up?