Basically I want to upload an image (which i've sorted) and scale it down to certain constraints such as max width and height but maintain the aspect ratio of the original image.
I don't have Imagick installed on the server - otherwise this would be easy.
Any help is appreciated as always. Thanks.
EDIT: I don't need the whole code or anything, just a push in the right direction would be fantastic.
Formule is wrong for keeping aspect ratio. It should be: original height / original width x new width = new height
works perfecly for me
Here is a comprehensive application that I worked hard on it to include most common operations like scale up & scale down, thumbnail, preserve aspect ratio, convert file type, change quality/file size and more...