javascript - Image upload, resizing and encoding to base64 crashes Chrome on mobile -
My users can select an image using the file-upload HTML input element - 1. From there I downscale 2 I convert to base 64 Chrome Mobile & amp; The Android browser displays a crash - and 'out of memory error'. If the browser runs on a more 'modern / enabled' device then it is perfectly fine. Here is the reason for the error - can this be corrected? Here is an action that gives down aspect ratio (keeping aspect ratio) and image base 64 string Resize the function and convert 64 (IMG, MaxWide, MaxHit) {var imgWidth = img.width, imgHeight = img.height; Var ratio = 1, ratio 1 = 1, ratio 2 = 1; Ratio 1 = MaxWide / IMG depth; Ratio 2 = max heitt / imgwr; // Use the smallest proportion that the image is the best fit in the MaxWith X MaxHoight box. If (ratio 1lt; ratio 2) {ratio = ratio 1; } And {ratio = ratio 2; } Var Canvas = document.createElement ("canvas"); Var Canvas Contact = Canvas. GateConttex ("2D"); Var canvas coppie = d...