def save_cover_data_to(data, path, bgcolor='#ffffff', resize_to=None, return_data=False, compression_quality=90, minify_to=None, grayscale=False):
 fmt = os.path.splitext(path)[1]
 if return_data:
  path = None
 if isinstance(data, Image):
  data = data.img
 return _save_cover_data_to(data, path, bgcolor=bgcolor, resize_to=resize_to, compression_quality=compression_quality, minify_to=minify_to, grayscale=grayscale, data_fmt=fmt)

def save_cover_data_to ( data , path , bgcolor = '#ffffff' , resize_to = None , return_data = False , compression_quality = 90 , minify_to = None , grayscale = False ) : fmt = os . path . splitext ( path ) [ 1 ] if return_data : path = None if isinstance ( data , Image ) : data = data . img return _save_cover_data_to ( data , path , bgcolor = bgcolor , resize_to = resize_to , compression_quality = compression_quality , minify_to = minify_to , grayscale = grayscale , data_fmt = fmt )
saves image in data to path .