Zoomable icon indicating copy to clipboard operation
Zoomable copied to clipboard

Crash with large images

Open T8RIN opened this issue 2 years ago • 7 comments

image

T8RIN avatar Mar 27 '24 14:03 T8RIN

Do you use ConstraintLayout?

usuiat avatar Mar 28 '24 13:03 usuiat

Nope

T8RIN avatar Mar 28 '24 13:03 T8RIN

Can you tell me how to reproduce this? I tried to show 8k image and my app crashed but the exception was different as yours.

 java.lang.RuntimeException: Canvas: trying to draw too large(162915712bytes) bitmap.

usuiat avatar Mar 28 '24 13:03 usuiat

Maybe 1/4000

T8RIN avatar Mar 28 '24 14:03 T8RIN

I recommend a similar image zooming library ZoomImage (https://github.com/panpf/zoomimage).

It perfectly supports Compose Multiplatform and Android View, supports zooming, panning, positioning, rotation, and subsampling of large images. It also integrates image loaders such as sketch, glide, picasso, coil, etc.

The most important thing is that it can zoom large images without memory overflow

panpf avatar Aug 08 '24 10:08 panpf

This is good, only for images tho, i will look

T8RIN avatar Aug 08 '24 19:08 T8RIN

This is good, only for images tho, i will look

No, it also works for any Compose component, such as Box, Text, please refer to the documentation: https://github.com/panpf/zoomimage/blob/main/docs/wiki/modifier_zoom.md

panpf avatar Aug 12 '24 08:08 panpf