Resizing an image on the client side
Posted: Mon Oct 29, 2007 10:33 am
I've seen lots of similar scripts but I've not found one that quite does what I need.
My site allows user to upload pictures. When displayed I want the images to stretch to 250px in one direction, width or height depending on which is greater, and keep the aspect ratio in the other direction (without going beyond 250px).
At the minute I have just set the HTML img element to this, but it distorts the ratio.
My site allows user to upload pictures. When displayed I want the images to stretch to 250px in one direction, width or height depending on which is greater, and keep the aspect ratio in the other direction (without going beyond 250px).
At the minute I have just set the HTML img element to this, but it distorts the ratio.
Code: Select all
width="250" height="250"