diff --git a/packages/core/src/textures/resources/BaseImageResource.js b/packages/core/src/textures/resources/BaseImageResource.js index 5944542..d0982b2 100644 --- a/packages/core/src/textures/resources/BaseImageResource.js +++ b/packages/core/src/textures/resources/BaseImageResource.js @@ -14,7 +14,10 @@ */ constructor(source) { - super(source.width, source.height); + const width = source.naturalWidth || source.videoWidth || source.width; + const height = source.naturalHeight || source.videoHeight || source.height; + + super(width, height); /** * The source element @@ -87,7 +90,10 @@ return; } - this.resize(this.source.width, this.source.height); + const width = this.source.naturalWidth || this.source.videoWidth || this.source.width; + const height = this.source.naturalHeight || this.source.videoHeight || this.source.height; + + this.resize(width, height); super.update(); }