fresco icon indicating copy to clipboard operation
fresco copied to clipboard

FetchDecodedImage resizes Uri from local file but keeps original size when Uri from Internet

Open brubraz opened this issue 11 years ago • 5 comments

I found a bug on Fresco 0.6.1.

I'm trying to get a bitmap from a file saved in my sd card, but when I fetchDecodedImage from a file the Bitmap is resized and consequently loses too much quality. However, when I try to fetchDecodedImage with a URI from Internet, the Bitmap isn't resized and doesn't lose quality.

Uri.fromFile(file) -> Lose quality Uri.parse("http://...") -> Don't lose quality

Why? I need to fetchDecodedImage with local file without lose quality. My image is .JPG and 1215x717. Example: http://ddragon.leagueoflegends.com/cdn/img/champion/splash/Akali_5.jpg

Difference between Uri's:

t

Code:

ImagePipeline imagePipeline = Fresco.getImagePipeline();
        DataSource<CloseableReference<CloseableImage>> dataSource = imagePipeline.fetchDecodedImage(ImageRequest.fromUri(Uri.fromFile(file)), getApplicationContext());
        dataSource.subscribe(new BaseBitmapDataSubscriber() {
            @Override
            protected void onNewResultImpl(@Nullable Bitmap bitmap) {
                // update notification big picture here
            }

            @Override
            protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) {}
        }, CallerThreadExecutor.getInstance());

Thanks

brubraz avatar Aug 20 '15 02:08 brubraz

Thanks for reporting this. Sounds like a bug, we are investigating.

plamenko avatar Aug 21 '15 18:08 plamenko

I have the same problem. And I convert the original jpg image to a png file, it seems to be all right. The image is not very big, just 490*870 px.

konieshadow avatar Sep 14 '15 11:09 konieshadow

I have the same issue on fresco 0.7. I find that when loading JPG images with high resolution(such as 1600 * 1200) from local file (uri starts with "file"), the issue happens. Either I converting the image to a png file or loading the same image from contentProvider(uri starts with "content"), fresco works well. I just use the sample app Fresco Uri App.

Aimarl0 avatar Sep 16 '15 07:09 Aimarl0

Having the exactly same issue. Please fix this as soon as possible. :(

TigerHix avatar Sep 25 '15 18:09 TigerHix

Fixed in v0.8.0

tyronen avatar Oct 19 '15 23:10 tyronen