I'm looking for a way to rotate an image in order to cut a rectangle inside this image and save it as a separate picture.
Edit: See accepted answer for solution.