Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I know how to determine height and width with Image::Info but I need to know how I can HTML resize (yes, just HTML. I know it'll load the whole image anyway but it'll fit better) if the image is greater than $max_height and $max_width.
The thing I can't figure out is how to keep the dimensions of the image PROPORTIONAL to it's original size so it doesn't look distorted when the HTML sizes it down.
For example, if the image is 1123x1243 and my max height/width is 800/600, I need to resize it so BOTH height and width are less than or equal to my max keeping the same ratio. I'd do an example here but I'm not sure how it's calculated.
|
|---|