qr_code_tools icon indicating copy to clipboard operation
qr_code_tools copied to clipboard

Update QrCodeToolsPlugin.kt

Open CellCS opened this issue 3 years ago • 1 comments

Fix Android crash issue when decoding very high size image: set maximum 5616(w), 3744(h), if processing image is larger than defined size, will use the scaled bitmap for QR decoding. This also avoids allocating too much memory in Android.

Crash reason:

if load one image with the size is 20000(w), 10000(h), like jpg size larger than 20M. onMethodCall function is trying to create intArray with size w*h (200000000), plus bitmap is the full size of image data. Android with 2G RAM crashes due to out-of-memory error (java.lang.OutOfMemoryError).

CellCS avatar Jul 24 '21 00:07 CellCS

link to issue #10

CellCS avatar Jul 24 '21 00:07 CellCS