I was wondering if it is possible to do some kind of function which will get the height of a constrained width image? I can get the original height by using:
list($width, $height, $type, $attr) = getimagesize($path."/images/".$image->image);
But my images on the page are constrained to be 580px wide:
<img src="/images/<?php echo $image->image; ?>" width="580" height="????" border="0" />
I was wondering if it were at all possible to get the new height of the constrained width image?
Its all about ratios. You already have the ratio of the width/height for the original. Now you just need to get it in terms of your 580px width. width/height is to 580/X