I'm trying to resize an image maintaining its aspect ratio such that its smallest size is 500px.
Using the code from this answer works, but it resize the image based on largest size.
So if we have a 2000x1000 image and we set size= 500,500 the resulting image will be 500x250, while I desire 1000x500. How can I do it?
Obviously these are random numbers.