While painting an image in landscape mode I change the position of the canvas with the canvas positioner so now my canvas is in portrait instead of landscape. (There is a reason why I do this.) I continue painting in portrait mode and wish to save as a portrait but it saves in original landscape mode.

The only way I have found to overcome this is to open the painting again (saved as landscape) and expand the canvas so it's large enough to rotate the painting to portrait and then crop unwanted canvas, I can now save as a portrait canvas. Transform doesn't work as it only transforms the paint layer and not the canvas.

Is there a better way?