Fixed handling of rotation for 90/270

The clip width/height weren't being swapped when the image width and
height were swapped, which caused the scale calculations to be wrong
(cutting off part of the resulting image)
Merge remote-tracking branch 'demotivator/master'