4

I am trying to display a JPEG image as it downloads like this library but its for IOS is there anything like this in android.

While R&D found this but its also for ios.

1) Right now i am using this way to load it works but the overhead is i have to load twice.

2) Also used fresco with .setProgressiveRenderingEnabled(true) but didt notice any major change.

Sohail Zahid
  • 8,099
  • 2
  • 25
  • 41

1 Answers1

1

First of all, you need to make sure your jpeg support progressive. Here's how

The easiest way to load progressive JPEG is using Fresco. But you need extra configuration to do this.

Here's the simplest code snippet to load progressive JPEG.

ImageRequest request = ImageRequestBuilder
.newBuilderWithSource(Uri.parse("http://pooyak.com/p/progjpeg/jpegload.cgi?o=1"))
.setProgressiveRenderingEnabled(true)
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
    .setImageRequest(request)
    .setOldController(imageView.getController())
    .build();
imageView.setController(controller);

// imageView is fresco SimpleDraweeView

Good luck!

aldok
  • 17,295
  • 5
  • 53
  • 64
  • @SohailZahid are you sure? I use the exact source code and it works just fine. What's your image url again? – aldok Mar 09 '17 at 08:03
  • @aldok , is it possible to implement progressive image rendering like Instagram.to be more clear,quality of the image start out low(blur) and gradually become clearer – Ajay Jayendran May 24 '18 at 19:51
  • Make sure your jpeg should be decoded as progressive jpeg otherwise it will not work. – Sohail Zahid Oct 11 '18 at 07:03