def create_profile_images(image_file, profile_image_names):
 storage = get_profile_image_storage()
 original = Image.open(image_file)
 image = _set_color_mode_to_rgb(original)
 image = _crop_image_to_square(image)
 for (size, name) in profile_image_names.items():
  scaled = _scale_image(image, size)
  exif = _get_corrected_exif(scaled, original)
  with closing(_create_image_file(scaled, exif)) as scaled_image_file:
   storage.save(name, scaled_image_file)

def create_profile_images ( image_file , profile_image_names ) : storage = get_profile_image_storage ( ) original = Image . open ( image_file ) image = _set_color_mode_to_rgb ( original ) image = _crop_image_to_square ( image ) for ( size , name ) in profile_image_names . items ( ) : scaled = _scale_image ( image , size ) exif = _get_corrected_exif ( scaled , original ) with closing ( _create_image_file ( scaled , exif ) ) as scaled_image_file : storage . save ( name , scaled_image_file )
generates a set of image files based on image_file and stores them according to the sizes and filenames specified in profile_image_names .