this is a really similar question to this one below
Js paste file size is bigger input file
The following below is my sample code to detect an image pasting event.
document.getElementById("imagePaste").onpaste = function (event) {
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
console.log(JSON.stringify(items)); // will give you the mime types
for (index in items) {
var item = items[index];
if (item.kind === 'file') {
var blob = item.getAsFile();
const file = new File([blob], 'test', { type: blob.type })
console.log("file.size: ", file.size);
}
}
}
Console logging file.size returns me a file size of 500kb, whereas uploading the exact same file is only 50kb (the actual image size is 50kb). Why is the size of the image increased so much?
Thanks in advance!