Most image editing software allows you to rotate an image by 90° in order to swap between portrait and landscape orientation. In The GIMP this is one of the operations referred to as a "Transformation". Additionally, The GIMP allows rotating the image contents within the existing canvas (the outline rectanlge within which the image appears), This is what happens if you use the GIMP's Rotation tool!
To rotate an image by 90°, from the image window open the Image menu, select Transform and then either "Rotate 90° clockwise" or "Rotate 90° anti-clockwise", as required.
To rotate an image by a variable amount, select the Rotate tool from the GIMP window. This adds a rotate marker to the pointer (seen above).
With the tool selected, click on the image and a circled cross-hair appears in the centre of the image, indicating the centre of rotatation. If you wish you may drag on this point to move the centre of rotation. Dragging elsewhere on the image will rotate it around this point.
For the simple correction of a badly aligned image there is little point in moving the centre of rotation as cropping will need to take place to restore the rectangular shape to the image. However, it can be useful when combining images in montages and editing multi-layers images.
As dragging begins the Rotate dialogue will be displayed. This can be used for fine correction of both the angle of rotation and the centre of rotation and must be used to confirm the operation. Crude control of the angle of rotation can be made with the slider control. The Reset button sets the angle of rotation to zero and the centre of rotation to the centre of the image. The Rotate button comletes the edit, redrawing the image with the settings shown and closing the dialogue. The Cancel button closes the dialogue abandoning the rotation
Redrawing the image.will inevitably result in both the loss of portions of the image beyond the canvass and creation of other transparent zones. The latter are indicated by a checker board pattern.
As, in most circumstances, it will be intended to restore a rectangualer shape to the image, you should expect to need to crop the image following any rotation. Cropping involves taking a rectangular portion from the centre of the image with a further inevitable loss of the corners of the image. The alternative is to use the option on the Image menu of the Image window, "Fit canvas to layers". This will restore the corners of the original image by expanding the canvas, with the result of larger transparent zones.
NOTE: Using the Rotate tool to turn an image by 90°, then fitting the canvas to the layer has the same effect as using the Transform menu option to rotate by 90°.