private void logScan(QualityInfo qualityInfo, boolean isFinalImage) {
    mDebugOutput.append(
        String.format(
            Locale.getDefault(),
            "%s: %s, goodEnough=%b, fullQuality=%b, quality=%d\n\n",
            mDateFormat.format(new Date(System.currentTimeMillis())),
            isFinalImage ? "final" : "intermediate",
            qualityInfo.isOfGoodEnoughQuality(),
            qualityInfo.isOfFullQuality(),
            qualityInfo.getQuality()));
    // Scroll to the bottom
    mDebugOutputScrollView.post(
        new Runnable() {
          @Override
          public void run() {
            mDebugOutputScrollView.scrollTo(0, mDebugOutputScrollView.getBottom());
          }
        });
  }
Progressive JPEG example that logs which frames of a progressive JPEG are rendered
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/pjpeg/ImageFormatProgressiveJpegFragment.java