Scale Image Using PHP and Maintaining Aspect Ratio
Actually the accepted solution it is not the correct solution. The reason is simple: there will be cases when the ratio of the source image and the ratio of the destination image will be different. Any calculation should reflect this difference. Please note the relevant lines from the example given on PHP.net website: $ratio_orig = … Read more