@Override
 protected int getIntermediateImageEndOffset(EncodedImage encodedImage) {
   return mProgressiveJpegParser.getBestScanEndOffset();
 }
 @Override
 protected int getIntermediateImageEndOffset(
     CloseableReference<PooledByteBuffer> imageBytesRef) {
   return mProgressiveJpegParser.getBestScanEndOffset();
 }