title: Calculate correct reduced in proportion photo size in width and height in php?
body: <p>I have 2 variables available about a photo i'm importing, width and height.(I could use imagesx etc, but i'm importing in bulk and it takes way too long)</p>
  
  <p>eg..</p>
  
  <pre><code>$w = 720;
  $h = 540;
  </code></pre>
  
  <p>How can I workout the correct height for the photo if I say the max width is 180px, I know the correct height should be 135px (on a standard landscape photo). But the starting width and height i'm given will change depending on the photo. </p>
  
  <p>Keeping the image in proportion what calculation do I need to do to workout the reduced width and height? </p>
  
  <p>Final result will be in pixels so can not have any decimal places.</p>
  
  <p>(I do not actually need to re-size the photo, just calculate the size.)</p>
  
  <p>Thanks in advance :)</p>