usuiat / Zoomable

Jetpack Compose library that enables contents zooming with pinch gesture.
https://usuiat.github.io/Zoomable/
Apache License 2.0
444 stars 25 forks source link

Crash with large images #195

Open T8RIN opened 8 months ago

T8RIN commented 8 months ago

image

usuiat commented 8 months ago

Do you use ConstraintLayout?

T8RIN commented 8 months ago

Nope

usuiat commented 8 months ago

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.
T8RIN commented 8 months ago

Maybe 1/4000

panpf commented 3 months ago

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

T8RIN commented 3 months ago

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

panpf commented 3 months ago

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