0

ShowSelectedImg(_image, info) {

    this.global.getConfig().API.external.general_API.get(_image).then(data => {

        const imgNew = new Image(); 

        this.show_image_editor = true;   
    
        imgNew.onload = () => {

            this.reloadImageEditor(_image);       
     
        };

        imgNew.onerror = () => {

            this.ShowSelectedImg(_image, info);
        }; 
        imgNew.src = _image;
        
    }).catch(error => {
    });

}
reloadImageEditor(path) {
    try {
        this.imageEditorNew.editorInstance.loadImageFromURL(path, "name").then(result => {
            let ui: any = this.imageEditorNew.editorInstance.ui;
            ui.activeMenuEvent();
            
        });
    }
    catch (e) {           
        
     }
}

[在此处输入图像描述][1] 当我尝试从服务器加载图像时,在 imageEditor 中渲染图像需要 10 到 15 秒,有时它会抛出错误,例如 'ERROR Error: Uncaught (in promise): Invalid image加载。[1]:https://i.stack.imgur.com/KagWY.jpg

4

0 回答 0