if (img.shape[1] > img.shape[0]):
            ratio = float(img.shape[1] / img.shape[0])
            new_height = Conf.desired_size
            new_width = int(new_height * ratio)