enrichPhoto static method

Future<PhotoWithThumbnail> enrichPhoto(
  1. String baseName,
  2. String thumbnailBaseName,
  3. Uint8List imgBytes
)

Implementation

static Future<PhotoWithThumbnail> enrichPhoto(
    String baseName, String thumbnailBaseName, Uint8List imgBytes) async {
  var img = imgpackage.decodeImage(imgBytes);
  if (img == null) {
    throw Exception('Can not decode image with baseName $baseName');
  }
  var thumbNailData = getThumbnail(img);

  return PhotoWithThumbnail(
    photoData: ImageData(
        baseName: baseName,
        width: img.width,
        height: img.height,
        data: imgBytes),
    thumbNailData: ImageData(
        baseName: thumbnailBaseName,
        width: thumbnailSize,
        height: thumbnailSize,
        data: thumbNailData),
  );
}