I'm really dumbfounded as to what is happenning here.
I'm using Preprocess.js to resize/compress an image on the front-end side. Except that, in the processfile() function on the image.onload (line 32), I'm converting the toDataURL() string to a Blob, so I can send it out as a file object to the API. To do this, I'm using the dataURItoBlob function. I end up with this :
image.onload = function() {
var resized = resizeMe(image, fileinput, max_width, max_height);
var blob = dataURItoBlob(resized);
eventImages[0] = blob;
}
I then send out the eventImage's content to the API.
Now, this works great. It resizes/compresses the image, it gets sent out to the API (with a success response) and I can see the output image within a webpage.
What happens though, is that in Chrome/Firefox's consoles (Resources tab), the image weight is quite big (8MB in Chrome, 1,5MB in Firefox).
What's even stranger is this: if I load the image within a webpage, it loads as if it was its compressed size. But if I load it from its direct link from the API, it takes a while to load and show up (as if it was loading 8MB/1,5MB of data).
What's going on here? Is it all on the front-end side? Is there something glitchy with browsers, the API, or a MIME/Content-type?
Thanks a million.