how to append base64 string in imageeditor

 Uncaught TypeError: Failed to execute 'putImageData' on 'CanvasRenderingContext2D': parameter 1 is not of type 'ImageData'.

    at e.open (imged.ej2.min.js:9:1298897)

    at ISpaceManager.5.2.27.01.js:20131:70

    at Object.success (PortalB.5.2.27.01.js:1984:17)

    at l (PortalCommon.5.2.27.01.min.js:1:35761)

    at Object.fireWith [as resolveWith] (PortalCommon.5.2.27.01.min.js:1:36573)

    at p (PortalCommon.5.2.27.01.min.js:1:73297)

    at XMLHttpRequest.<anonymous> (PortalCommon.5.2.27.01.min.js:1:79056)


when I try to append base64 string I get this kind of error



1 Reply

YA YuvanShankar Arunagiri Syncfusion Team May 2, 2023 12:05 PM UTC

Hi Sanjeevi,


Using the open method of Image Editor component, we can load the base64 string to image editor component shown as below.


UG link: https://ej2.syncfusion.com/javascript/documentation/image-editor/open-save/


document.getElementById('btn2').onclick = function() {

  imageEditorObj.open(base64String);

}


Sample link: https://stackblitz.com/edit/7o9kt1?file=index.js


Get back to us if you need any further assistance on this.


Regards,

YuvanShankar A


Loader.
Up arrow icon