Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def load_image_file(file_path):
file = await StorageFile.get_file_from_path_async(os.fspath(file_path))
stream = await file.open_async(FileAccessMode.READ)
decoder = await BitmapDecoder.create_async(stream)
software_bitmap = await decoder.get_software_bitmap_async()
return VideoFrame.create_with_software_bitmap(software_bitmap)