Javascript Resize Image With Aspect Ratio. The same aspect ratio. I plan to use it with javascript to crop an image to fit the entire window.
This code will show how to resize an image using javascript before upload it to the server. Or vice versa set the height of the image and the width to auto. The same aspect ratio.
So far i have to use cases.
The aspect ratio will be calculated by using the dimensions of the original image. In this tutorial i have used jquery ajax to access the image resize function in a php class. This means each side of the output image has the same length. Adjust the width and height attributes of the image such that it maintains its aspect ratio and fits within 150x15o area.