fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Show a large image very un-effective

Open duguguiyu opened this issue 11 years ago • 6 comments

When load a large image(3k*5k), the app may be no response...

duguguiyu avatar May 31 '15 15:05 duguguiyu

In nexus5 (4.4.2), it's ok. In nexus6 (5.1), the app is no response...

duguguiyu avatar Jun 01 '15 04:06 duguguiyu

Perhaps you should resize your image first. See Resizing.

plamenko avatar Jun 02 '15 12:06 plamenko

Normally, we do not support that big images. 3k * 5k * 4Bpp = 60 MB. On 5.1 (Lollipop) that single image (unless resized) would eat the whole java heap of your application. On older versions of android we will allocate that image on the native heap which doesn't have such strict limits as java heap, but it is still not okay to load a 60MB image in memory. You should really resize the image first. Let us know if that helps.

plamenko avatar Jun 02 '15 12:06 plamenko

I know the Resize Option, but i don't know the image's size (load from web), how to deal with it?

duguguiyu avatar Jun 05 '15 06:06 duguguiyu

You don't need to know your image's size. You only need to know your view size. If you don't know the exact size, estimate. You could start with the screen resolution of your device, if a full-screen image. If you think it would be, say, one fifth of the full screen, choose the resolution / 5.

tyronen avatar Jun 07 '15 23:06 tyronen

I've just created a big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling Scale Image View, Fresco, Glide, and Picasso https://github.com/Piasy/BigImageViewer , hope it helps :)

Piasy avatar Nov 09 '16 01:11 Piasy