evaluateInIsolate function

Future<QualityReport> evaluateInIsolate(
  1. Uint8List bytes, [
  2. QualityConfig config = QualityConfig.document
])

Decodes and evaluates bytes on a short-lived background isolate (Isolate.run), so a large photo does not block the UI isolate.

Throws UndecodableImageException if the bytes cannot be decoded.

Implementation

Future<QualityReport> evaluateInIsolate(
  Uint8List bytes, [
  QualityConfig config = QualityConfig.document,
]) =>
    Isolate.run(() => ImageQualityGate(config).evaluate(bytes));