diff --git a/src/core/textures/ImageTexture.ts b/src/core/textures/ImageTexture.ts index 73901cba..24efd7f6 100644 --- a/src/core/textures/ImageTexture.ts +++ b/src/core/textures/ImageTexture.ts @@ -170,8 +170,8 @@ export class ImageTexture extends Texture { premultiplyAlpha: hasAlphaChannel, }; } else { - const img = new Image(width || undefined, height || undefined); - if (!(src.substr(0, 5) === 'data:')) { + const img = new Image(); + if (!src.startsWith('data:')) { img.crossOrigin = 'Anonymous'; } img.src = src;