Get image aspect ratio
<p>I'm currently trying to get the aspect ratio of an image using PHP. For example, using those values : </p>

<pre><code>$thumb_width = 912;
$thumb_height = 608;
</code></pre>

<p>I would be able to get the aspect ratio (16:9, 3:2, 2:3, etc.). So in this case :</p>

<pre><code>$ratio = '3:2';
</code></pre>

<p>The thing is: I don't know what new width or height it will be. so I can't do something like that : <code>(original height / original width) x new width = new height</code></p>

<p>Any ideas ?</p>

<p><em>Note: I don't want to resize an image, just calculate its aspect ratio with its width and height.</em></p>