I am creating a mobile app., where the user can choose a picture from mobile then I blur it.... The problem is that when the user choose a large picture(More than 2 MB), the app. crash.
JS Code:
convert_local_image_base64: function(url, callback) {
var canvas = document.createElement('CANVAS'),
ctx = canvas.getContext('2d'),
img = new Image;
img.crossOrigin = 'anonymous';
img.onload = function() {
canvas.height = img.height;
canvas.width = img.width;
ctx.drawImage(img, 0, 0);
var dataURL = canvas.toDataURL('image/png');
callback.call(this, dataURL);
canvas = null;
};
img.src = url;
},
So does there are another way to achieve similar operation?!.