Please note this is a self-answered question.
This question is about the ToastUI Image Editor v3.3.0, but it may also apply to newer versions.
When you load an image using this official example:
// Create image editor
var imageEditor = new tui.component.ImageEditor('#my-image-editor canvas', {
cssMaxWidth: 1000, // Component default value: 1000
cssMaxHeight: 800 // Component default value: 800
});
// Load image
imageEditor.loadImageFromURL('img/sampleImage.jpg', 'My sample image')
The editor will not load the image. The function neither throws, nor returns anything indicating a failure and you don't get any error messages. It returns a promise that resolves as specified in the documentation.
It only loads an image by specifying it in the initial config and you can't change it afterwards:
// Create image editor
var imageEditor = new tui.component.ImageEditor('#my-image-editor canvas', {
includeUI: {
loadImage: {
path: 'img/sampleImage.jpg',
name: 'My sample image'
},
},
cssMaxWidth: 1000, // Component default value: 1000
cssMaxHeight: 800 // Component default value: 800
});
It appears that the loadImageFromURL function is broken and according to other users loadImageFromFile
has the same problem.
Issues about this have been raised on GitHub, but have basically been ignored. It's been a month now and unfortunately it still hasn't been fixed.
So the question is how can the image editor be tricked into working while this issue exists.
Here is a fiddle showing that it doesn't work: https://fiddle.sencha.com/#view/editor&fiddle/2org