decodeJpgFile function

Future<Image?> decodeJpgFile(
  1. String path
)

Decode a JPG formatted image from a file. If the platform does not support dart:io, null will be returned.

Implementation

Future<Image?> decodeJpgFile(String path) async {
  final bytes = await readFile(path);
  if (bytes == null) {
    return null;
  }
  return JpegDecoder().decode(bytes);
}