-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace image in canvas coming blank #6372
Comments
Please try to reproduce it on a working fiddle or codepen. |
@asturur I fixed that issue my own, thanks for your support here. |
glad to hear that! |
Hello, My only solution now is to put the updateElementSrc(element, src) {
const { width, height } = element;
return new Promise(resolve => {
element.setSrc(src, () => {
element.set({ width, height, dirty: true });
setTimeout(() => {
editor.canvas.renderAll();
resolve();
}, 10);
});
});
}, The callback runs after the image was loaded (i can inspect it in the network panel), but it depends on my internet connection, how long i have to set the timeout. So there is obviously something wrong. (Edit: It has something to do with the crossOrigin option i set to the image element - s. #6397) |
@dkirchhof : Just add }, {crossOrigin: 'annonymous'});, and there you go. it is aolved.
|
Version
3.1.0
Information about environment
browser
Chrome, Safari, Firefox
Steps to reproduce
This is my code to just simply replace an image on canvas with existing image component.

But the thing is that after replace image is coming blank like this.
when I click anywhere on canvas then the image is rendering properly.
I am using it with Angular 8
Expected Behavior
Image should render
Actual Behavior
image is coming blank.
The text was updated successfully, but these errors were encountered: