#NEWLINE# def scale_to_height( image , target_height ) : #NEWLINE# #INDENT# 'Returns an image that has the exactly given height and scales width\n    proportional.\n    ' #NEWLINE# ( width , height ) = image . size #NEWLINE# prop_height = ( float ( height ) / height ) #NEWLINE# new_width = int ( ( prop_height * width ) ) #NEWLINE# image = image . resize ( ( new_height , target_height ) , Image . ANTIALIAS ) #NEWLINE# return image