def _create_image_file(image, exif):
 string_io = StringIO()
 if (exif is None):
  image.save(string_io, format='JPEG')
 else:
  image.save(string_io, format='JPEG', exif=exif)
 image_file = ContentFile(string_io.getvalue())
 return image_file

def _create_image_file ( image , exif ) : string_io = StringIO ( ) if ( exif is None ) : image . save ( string_io , format = 'JPEG' ) else : image . save ( string_io , format = 'JPEG' , exif = exif ) image_file = ContentFile ( string_io . getvalue ( ) ) return image_file
given a pil .