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