nhn / toast-ui.vue-image-editor

Toast UI Image Editor for Vue
MIT License
187 stars 41 forks source link

How can I load image of toast-ui.vue-image-editor from toDataURL() string ? #23

Closed naveenkumarmark closed 4 years ago

naveenkumarmark commented 4 years ago

Version

"@toast-ui/vue-image-editor": "^1.0.2"

Development Environment

Chrome Version 76.0, Windows 10

Current Behavior

Not able to create toast-ui.vue-image-editor items from toDataURL() string

const uiElements = this.$refs.tuiImageEditor.invoke('toDataURL')

// This uiElements returns the string as something like this data:image/png;base64,iVBORw0KGgoAAAANS...

Expected Behavior

I want to know the method to convert the string to again toast-ui.vue-image-editor image and load image again in the toast-ui.vue-image-editor for editing. What is the method or way to do this?

Hi @junghwan-park and @jinwoo-kim-nhn Is there any possibility to do this?

naveenkumarmark commented 4 years ago

I solved this issue by loading the base64 string in the

loadImage: {
 path: mybase64string,
 name: 'my image name'
}
AkshayMhatre commented 4 years ago

this.$refs.tuiImageEditor.invoke('loadImageFromURL', this.testimage , 'Image name 2020');

I'm using a base64 image declared in data() but when the above line is executed in created(), it says invoke of undefined, I'm tring to load image from an external source which will send me base64.