decodeNamedImage function

Image? decodeNamedImage(
  1. List<int> bytes,
  2. String name
)

Identify the format of the image using the file extension of the given name, and decode the given file bytes to a single frame Image. See also decodeImage.

Implementation

Image? decodeNamedImage(List<int> bytes, String name) {
  final decoder = getDecoderForNamedImage(name);
  if (decoder == null) {
    return null;
  }
  return decoder.decodeImage(bytes);
}