I am trying to resize an image when uploading a file before uploading the image to the server. I found a decent plugin that returns the blob of the updated image, however I cannot find how to assign the blob back to the file object that the download is using.
Drops look like this: data: image / jpeg; base64, / 9j / 4AAQSkZJRgABAQAAAQAB .....
var file = e.target.files[0]; canvasResize(file, { width: 300, height: 0, crop: false, quality: 80, //rotate: 90, callback: function (data, width, height) { // How to assign the data blob back to the file? //$(file).attr('src', data); // THEN submit with the smaller photo $('#PhotoForm').ajaxSubmit(options); } });
Thanks!
source share