Image Resize with PHP while Maintaining Proportions
There are many examples found on the web on resizing images using PHP while maintaining aspect ratio. However most of them are based on a single maximum dimension i.e. should not exceed a certain size with on either height or width.
I have written the code below that will accept a desired height and width and downsize the source image without exceeding either $maxheight or $maxwidth but still maintain proportions.
Adjust your path to ImageMagick accordingly (/usr/bin/convert)
