From 134b8369850e7d81feecf6b19557264a25b5b52e Mon Sep 17 00:00:00 2001 From: drewbitt Date: Fri, 15 Nov 2019 11:14:33 -0500 Subject: [PATCH] Use proper size for 10MB --- src/utils/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/main.js b/src/utils/main.js index 669344a..cc097ec 100644 --- a/src/utils/main.js +++ b/src/utils/main.js @@ -23,7 +23,7 @@ export function searchAnime(files) { // Confirm size less than 10MB after converting to base64 const buffer = Buffer.from(based.substring(based.indexOf(",") + 1)); - const bufferSize = Math.floor(buffer.length / 1024 ** (2 ** 2)); + const bufferSize = Math.floor((buffer.length / 1024 ** 2) * 10); if (!bufferSize < 1) { return Promise.reject( new Error("You should ensure your Base64 encoded image is < 10MB")