def resize_height(image, size, resample=Image.LANCZOS):
    """
    Resize image according to size.
    image:      a Pillow image instance
    size:       an integer or a list or tuple of two integers [width, height]
    """
    try:
        height = size[1]
    except:
        height = size
    img_format = image.format
    img = image.copy()
    img_size = img.size
    # If the origial image has already the good height, return it
    # fix issue #16
    if img_size[1] == height:
        return image
    new_width = int(math.ceil((height / img_size[1]) * img_size[0]))
    img.thumbnail((new_width, height), resample)
    img.format = img_format
    return img
def resize_height(image, size, resample=Image.LANCZOS):
    
    try:
        height = size[1]
    except:
        height = size
    img_format = image.format
    img = image.copy()
    img_size = img.size
    
    
    if img_size[1] == height:
        return image
    new_width = int(math.ceil((height / img_size[1]) * img_size[0]))
    img.thumbnail((new_width, height), resample)
    img.format = img_format
    return img
def resize_height ( image , size , resample = Image . LANCZOS ) : try : height = size [ 1 ] except : height = size img_format = image . format img = image . copy ( ) img_size = img . size # If the origial image has already the good height, return it # fix issue #16 if img_size [ 1 ] == height : return image new_width = int ( math . ceil ( ( height / img_size [ 1 ] ) * img_size [ 0 ] ) ) img . thumbnail ( ( new_width , height ) , resample ) img . format = img_format return img
Resize image according to size.
    image:      a Pillow image instance
    size:       an integer or a list or tuple of two integers [width, height]
Resize image according to size . image : a Pillow image instance size : an integer or a list or tuple of two integers [ width height ]