I php need to resize an image so that both width and height after resize should be less than or equal to the expected resized values.
consider the source image is 680x520
The needed thumbmail size should be <= 300x200
I want to find the resized proportional value which should be less than or equal to 300x200.
it can be like 299x199 or 300x200 but not greater than 300 in width and 200 in height.
So both should be less than or equal to the needed size.
What could be the formula?