Skip to content

Commit

Permalink
fix: image size on browsers without createImageBitmap (#412)
Browse files Browse the repository at this point in the history
This PR addresses an issue specific to 2017 Samsung TVs, which do not
support the createImageBitmap method.

**Testing**

Tested on 2017 Samsung TVs with renderer+solid.
  • Loading branch information
wouterlucas authored Oct 15, 2024
2 parents 76c563d + 05c0730 commit f4e4619
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/textures/ImageTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f4e4619

Please sign in to comment.