@Override
  public void produceResults(
      final Consumer<EncodedImage> consumer, final ProducerContext producerContext) {

    final ProducerListener2 listener = producerContext.getProducerListener();
    final ImageRequest imageRequest = producerContext.getImageRequest();

    producerContext.putOriginExtra("local", "exif");
    final StatefulProducerRunnable<EncodedImage> cancellableProducerRunnable =
        new StatefulProducerRunnable<EncodedImage>(
            consumer, listener, producerContext, PRODUCER_NAME) {
          @Override
          protected @Nullable EncodedImage getResult() throws Exception {
            final Uri sourceUri = imageRequest.getSourceUri();

            final ExifInterface exifInterface = getExifInterface(sourceUri);
            if (exifInterface == null || !exifInterface.hasThumbnail()) {
              return null;
            }

            byte[] bytes = Preconditions.checkNotNull(exifInterface.getThumbnail());
            PooledByteBuffer pooledByteBuffer = mPooledByteBufferFactory.newByteBuffer(bytes);
            return buildEncodedImage(pooledByteBuffer, exifInterface);
          }

          @Override
          protected void disposeResult(@Nullable EncodedImage result) {
            EncodedImage.closeSafely(result);
          }

          @Override
          protected Map<String, String> getExtraMapOnSuccess(final @Nullable EncodedImage result) {
            return ImmutableMap.of(CREATED_THUMBNAIL, Boolean.toString(result != null));
          }
        };
    producerContext.addCallbacks(
        new BaseProducerContextCallbacks() {
          @Override
          public void onCancellationRequested() {
            cancellableProducerRunnable.cancel();
          }
        });
    mExecutor.execute(cancellableProducerRunnable);
  }
Checks whether the producer may be able to produce images of the specified size. This makes no
promise about being able to produce images for a particular source, only generally being able
to produce output of the desired resolution.

<p>In this case, assumptions are made about the common size of EXIF thumbnails which is that
they may be up to 512 pixels in each dimension.

@param resizeOptions the resize options from the current request
@return true if the producer can meet these needs
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/LocalExifThumbnailProducer.java