getThumbnail static method

Uint8List getThumbnail(
  1. Image img
)

Implementation

static Uint8List getThumbnail(Image img) {
  int thumbnailWidth = 0;
  int thumbnailHeight = 0;
  if (img.width > img.height) {
    thumbnailWidth = thumbnailSize;
  } else {
    thumbnailHeight = thumbnailSize;
  }
  var thumbnail = imgpackage.copyResize(img,
      width: thumbnailWidth, height: thumbnailHeight);
  var thumbNailData = Uint8List.fromList(imgpackage.encodePng(thumbnail));
  return thumbNailData;
}