createThumbnails_fromImage method
Implementation
Uint8List? createThumbnails_fromImage(Uint8List image_payload, {int width = 80, int height = 100}) {
var imgOri = img.decodePng(image_payload);
if (imgOri == null) imgOri = img.decodeJpg(image_payload);
if (imgOri == null) imgOri = img.decodeBmp(image_payload);
if (imgOri == null) imgOri = img.decodeImage(image_payload);
if (imgOri == null) imgOri = img.decodeExr(image_payload);
if (imgOri == null) imgOri = img.decodeGif(image_payload);
if (imgOri == null) return null;
var resizedImg = img.copyResize(imgOri, width: width, height: height);
final pngBytes = img.encodePng(resizedImg);
return pngBytes;
}