If I drop an image file into the TinyMCE editor the drop event in the DOM contains the file in the DataTransferItemList object in the event. I wish to resize this image before it is dropped but I can't see how to do that if the DataTransferItemList is not writable for the drop event as stated here - https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/clear
Which means that I cannot do something like this as it will not replace the item at 0.
editor.ondrop = function(event) {
event.dataTransfer.items[0] = resizeImageFunction(event.dataTransfer.items[0].getAsFile());
}
How would I be able to change the image before it is dropped into the editor?