decodeImageFile function
Implementation
Future<Image?> decodeImageFile(String filePath) async {
final image = decodeImage(await File(filePath).readAsBytes());
if (image == null) {
throw NoDecoderForImageFormatException(filePath);
}
return image;
}