2

I'm using Fresco to display images from the local drive. My problem is that Fresco won't display the full high quality image in the DraweeView, instead it displays tiny images with very low quality as seen here:

Fresco displaying a low quality image

(I've also viewed the picture with actualImageScaleType="fitCenter" so it's not just that they are high quality pictures with small size, they're actually very bad quality, and very low resolution.)

The images are taken by the phone's 8 megapixel camera, so they are of good quality. I've also looked at them on my computer, and seen the high quality 8 megapixel images. So I must be doing something wrong and somehow displaying a low quality image.

In the layout xml I have the following defining the SimpleDraweeView element:

<com.facebook.drawee.view.SimpleDraweeView
  android:id="@+id/image_gallery_drawee_view"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  fresco:placeholderImage="@drawable/ic_photo_black_48dp"
  fresco:placeholderImageScaleType="fitCenter"
  fresco:actualImageScaleType="center" />

Then in the code:

GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(context.getResources())
                                       .setActualImageScaleType(ScalingUtils.ScaleType.FIT_XY)
                                       .build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
                                    .setUri(Uri.parse(FILE_LOADER_PREFIX.concat(images.get(position)
                                                                                      .getLocalImagePath())))
                                    .setOldController(draweeView.getController())
                                    .build();

draweeView.setHierarchy(hierarchy);
draweeView.setController(controller);

What do I need to do for Fresco to display the high resolution/quality image?

UPDATE: These said images are not compressed, but just saved via fileOutputStream.write(imageByteArray). Now if I change this and compress the images using bitmap.compress(Bitmap.CompressFormat.JPEG, 75, bufferedOutputSteam), a high quality image will be displayed in the DraweeView. However, this way the application drastically slows down.

Mehmet K
  • 2,805
  • 1
  • 23
  • 35

1 Answers1

0

I am part of the Fresco team and may be able to help. What version of Fresco are you using? We had a bug that got fixed recently which would cause some local images to be displayed as thumbnails. This definitely looks like a manifestation of that bug and upgrading to the latest Fresco may help.

plamenko
  • 1,068
  • 1
  • 8
  • 10