@galacean/engine-loader 1.3.8 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6885,9 +6885,14 @@ var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser1) {
6885
6885
  var _this;
6886
6886
  _this = GLTFExtensionParser1.call(this) || this;
6887
6887
  _this._supportWebP = false;
6888
- var testCanvas = engineMiniprogramAdapter.document.createElement("canvas");
6889
- testCanvas.width = testCanvas.height = 1;
6890
- _this._supportWebP = testCanvas.toDataURL("image/webp").indexOf("data:image/webp") == 0;
6888
+ // @ts-ignore
6889
+ if (miniprogram.SystemInfo._isBrowser) {
6890
+ var testCanvas = engineMiniprogramAdapter.document.createElement("canvas");
6891
+ testCanvas.width = testCanvas.height = 1;
6892
+ _this._supportWebP = testCanvas.toDataURL("image/webp").indexOf("data:image/webp") == 0;
6893
+ } else {
6894
+ _this._supportWebP = false;
6895
+ }
6891
6896
  return _this;
6892
6897
  }
6893
6898
  var _proto = EXT_texture_webp.prototype;
package/dist/module.js CHANGED
@@ -6881,9 +6881,14 @@ var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser1) {
6881
6881
  var _this;
6882
6882
  _this = GLTFExtensionParser1.call(this) || this;
6883
6883
  _this._supportWebP = false;
6884
- var testCanvas = document.createElement("canvas");
6885
- testCanvas.width = testCanvas.height = 1;
6886
- _this._supportWebP = testCanvas.toDataURL("image/webp").indexOf("data:image/webp") == 0;
6884
+ // @ts-ignore
6885
+ if (SystemInfo._isBrowser) {
6886
+ var testCanvas = document.createElement("canvas");
6887
+ testCanvas.width = testCanvas.height = 1;
6888
+ _this._supportWebP = testCanvas.toDataURL("image/webp").indexOf("data:image/webp") == 0;
6889
+ } else {
6890
+ _this._supportWebP = false;
6891
+ }
6887
6892
  return _this;
6888
6893
  }
6889
6894
  var _proto = EXT_texture_webp.prototype;