private void doPostprocessing(CloseableReference<CloseableImage> sourceImageRef, int status) {
      Preconditions.checkArgument(CloseableReference.isValid(sourceImageRef));
      if (!shouldPostprocess(sourceImageRef.get())) {
        maybeNotifyOnNewResult(sourceImageRef, status);
        return;
      }
      mListener.onProducerStart(mProducerContext, NAME);
      CloseableReference<CloseableImage> destImageRef = null;
      try {
        try {
          destImageRef = postprocessInternal(sourceImageRef.get());
        } catch (Exception e) {
          mListener.onProducerFinishWithFailure(
              mProducerContext, NAME, e, getExtraMap(mListener, mProducerContext, mPostprocessor));
          maybeNotifyOnFailure(e);
          return;
        }
        mListener.onProducerFinishWithSuccess(
            mProducerContext, NAME, getExtraMap(mListener, mProducerContext, mPostprocessor));
        maybeNotifyOnNewResult(destImageRef, status);
      } finally {
        CloseableReference.closeSafely(destImageRef);
      }
    }
Performs postprocessing and takes care of scheduling.
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/PostprocessorProducer.java