Does anyone know of a way to take an image and resample it but keep it to scale? I have lots of code that can make a perfect square image but not all the images being uploaded are perfect squares.
Basically, I need to take the uploaded image and check if the width or height are greater then 250. If either are, I need to resample the image to make sure both the height and width remain less then 250.
Once I have that figured out, I need to take the image and make a thumbnail where the largest width or height dimension is 40 pixels. Even if it's 40x1.
Any help on this is greatly appreciated.