From 48154a8d657172548c18b4b3cb38d66844155199 Mon Sep 17 00:00:00 2001 From: MattMo Date: Sun, 6 Mar 2022 20:19:23 -0800 Subject: [PATCH] Editable image now uses a blob instead of raw base64 image data for the source. --- editable-image.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/editable-image.js b/editable-image.js index 7b7533e..8b9ccb6 100644 --- a/editable-image.js +++ b/editable-image.js @@ -81,18 +81,9 @@ class EditableImage extends IgniteElement { if (this.fileInput.files.length > 0) { var file = this.fileInput.files[0]; - //Create a reader to read in the file. - var reader = new FileReader(); - reader.onload = (event) => { - this.source = event.target.result; + this.source = URL.createObjectURL(file); - //Invoke a native change event now that we have - //the image file ready. - this.dispatchEvent(new Event("change")); - }; - - //Read it. - reader.readAsDataURL(file); + this.dispatchEvent(new Event("change")); } }