Given an image:
maxWidth = 400;
maxHeight = 200;
width = photo.Width;
height = photo.Height;
How would I go about scaling the image if either dimension exceeds the maximum properties?
Here are some test cases:
300x300 : Too tall, but width ok.
500x200 : Too wide, but height ok.
650x300 : Too tall and too wide
300x190 : Fine, don't resize
I'm having trouble visualising the maths for this, sorry if it's too simple! The case giving me most trouble is the one where both dimensions exceed the max allowed.