client icon indicating copy to clipboard operation
client copied to clipboard

[Android] Crash when displaying large images (Pixel 8 Pro, Android 15) — Canvas: trying to draw too large bitmap

Open rajtsic opened this issue 8 months ago • 0 comments

Describe the bug When trying to send or view a high-resolution image (6144x8160 pixels, taken with Pixel 8 Pro 50MP camera) in a chat, Keybase crashes with the error: java.lang.RuntimeException: Canvas: trying to draw too large(200540160bytes) bitmap.

The image is around 7.6MB on disk (JPEG), but when Android tries to draw it, it uses ~200MB RAM because of the pixel dimensions. The crash happens immediately after adding the photo.

To Reproduce Steps to reproduce the behavior: Go to any chat Click on Camera button > Photo from library > pick a Pixel 50MP picture (6144x8160) Add it to the chat App crashes on load

Expected behavior The app should properly downscale large images before rendering them, to prevent Canvas from crashing.

Additional numbers The number 345567

rajtsic avatar Apr 25 '25 22:04 rajtsic