I\'m having a little bit of a problem scaling my images to a properly predefined size. I was wondering - since it is purely mathematics, if there\'s some sort of common logi
Dark Shikari has it. Your solution as stated in the question fails because you aren't first establishing which dimenson's size-to-maxsize ratio is greater and then reducing both dimensions by that greater ratio.
Your current solution's use of a serial, conditional analysis of one potential dimensional violation and then the other won't work.
Note also that if you want to upscale images, your current solution won't fly, and Dark Shikari's again will.