Search in sources :

Example 1 with ProgressiveJpegParser

use of com.facebook.imagepipeline.decoder.ProgressiveJpegParser in project fresco by facebook.

the class DecodeProducer method produceResults.

@Override
public void produceResults(final Consumer<CloseableReference<CloseableImage>> consumer, final ProducerContext producerContext) {
    final ImageRequest imageRequest = producerContext.getImageRequest();
    ProgressiveDecoder progressiveDecoder;
    if (!UriUtil.isNetworkUri(imageRequest.getSourceUri())) {
        progressiveDecoder = new LocalImagesProgressiveDecoder(consumer, producerContext, mDecodeCancellationEnabled);
    } else {
        ProgressiveJpegParser jpegParser = new ProgressiveJpegParser(mByteArrayPool);
        progressiveDecoder = new NetworkImagesProgressiveDecoder(consumer, producerContext, jpegParser, mProgressiveJpegConfig, mDecodeCancellationEnabled);
    }
    mInputProducer.produceResults(progressiveDecoder, producerContext);
}
Also used : ProgressiveJpegParser(com.facebook.imagepipeline.decoder.ProgressiveJpegParser) ImageRequest(com.facebook.imagepipeline.request.ImageRequest)

Aggregations

ProgressiveJpegParser (com.facebook.imagepipeline.decoder.ProgressiveJpegParser)1 ImageRequest (com.facebook.imagepipeline.request.ImageRequest)1