Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with large images #195

Open
T8RIN opened this issue Mar 27, 2024 · 7 comments
Open

Crash with large images #195

T8RIN opened this issue Mar 27, 2024 · 7 comments

Comments

@T8RIN
Copy link

T8RIN commented Mar 27, 2024

image

@usuiat
Copy link
Owner

usuiat commented Mar 28, 2024

Do you use ConstraintLayout?

@T8RIN
Copy link
Author

T8RIN commented Mar 28, 2024

Nope

@usuiat
Copy link
Owner

usuiat commented Mar 28, 2024

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
Copy link
Author

T8RIN commented Mar 28, 2024

Maybe 1/4000

@panpf
Copy link

panpf commented Aug 8, 2024

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
Copy link
Author

T8RIN commented Aug 8, 2024

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

@panpf
Copy link

panpf commented Aug 12, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants