I am trying to either find a way to calculate the width and height ratio of an image so if I resize the image, it will proportionally resize correctly. Is there such a script?
For example an image is 500×750 and the container that holds the image is maximum 350 width…So I need the script to calculate what the height should be in proportion to the 350 width.
Thanks.
Best Answer
Use Javascript.
See this tutorial: http://www.ajaxblender.com/howto-resize-image-proportionally-using-javascript.html
Using the function the other guy posted: