qr_code_tools
qr_code_tools copied to clipboard
Update QrCodeToolsPlugin.kt
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).
link to issue #10