PHP: If image too wide or tall downsize and constrain proportions.
<p>I am guessing probably need to use GD image library for this but I need some help being pointed in the right direction.</p>

<p>I display an image on a page and if it is over 800px wide I want to downscale it to 800 px wide but scale the height proportionally and if its over 600px tall I want to do the same.</p>

<p>What's the best way of achieving this?</p>
