def thumb_scale_size(orig_width, orig_height, width, height):
 if (width is None):
  width = scale_aspect(orig_width, orig_height, height)
 elif (height is None):
  height = scale_aspect(orig_height, orig_width, width)
 elif ((orig_width * height) >= (orig_height * width)):
  width = scale_aspect(orig_width, orig_height, height)
 else:
  height = scale_aspect(orig_height, orig_width, width)
 return (width, height)

def thumb_scale_size ( orig_width , orig_height , width , height ) : if ( width is None ) : width = scale_aspect ( orig_width , orig_height , height ) elif ( height is None ) : height = scale_aspect ( orig_height , orig_width , width ) elif ( ( orig_width * height ) >= ( orig_height * width ) ) : width = scale_aspect ( orig_width , orig_height , height ) else : height = scale_aspect ( orig_height , orig_width , width ) return ( width , height )
determine size to scale to scale for thumbnailst params params: orig_width .