function img = imresizeAspect(img, maxSize) % function img = imresizeAspect(img, maxSize) % If image is larger than max size, reduce size, preserving aspect ratio of input. % % If size(input) = [y x] and maxSize = [yy xx], % then size(output) is given by the following (where a=y/x) % if y