Explorar o código

use byteLength to get buffer size

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
573d3c71b9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/single-file/single-file-browser.js

+ 1 - 1
lib/single-file/single-file-browser.js

@@ -46,7 +46,7 @@ this.SingleFile = (() => {
 				try {
 					const buffer = await resourceContent.arrayBuffer();
 					const dataURI = "data:" + (contentType || "") + ";" + "base64," + base64.fromByteArray(new Uint8Array(buffer));
-					if (options.maxSize && buffer.size > options.maxSize * ONE_MB) {
+					if (options.maxSize && buffer.byteLength > options.maxSize * ONE_MB) {
 						return "data:base64,";
 					} else {
 						return dataURI;