From 1ab2a18cfc9a4ab243a2a9d3dc463961969f72cf Mon Sep 17 00:00:00 2001 From: deathbyprograms <24487592+deathbyprograms@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:49:32 -0700 Subject: [PATCH] Image Utitilies - Fix context menu downloads --- Plugins/ImageUtilities/ImageUtilities.plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/ImageUtilities/ImageUtilities.plugin.js b/Plugins/ImageUtilities/ImageUtilities.plugin.js index 37bf71389d..f5ddc968e5 100644 --- a/Plugins/ImageUtilities/ImageUtilities.plugin.js +++ b/Plugins/ImageUtilities/ImageUtilities.plugin.js @@ -1546,9 +1546,9 @@ module.exports = (_ => { requestFile (urls, onLoad, onError, config = {}) { if (!urls || typeof onLoad != "function") return typeof onError == "function" && onError(); let url = (urls.url && urls.url.startsWith("/assets") ? (window.location.origin + urls.url) : urls.url || ""); - let isResized = !config.orignalSizeChecked && (url.indexOf("?width=") > -1 || url.indexOf("?height=") > -1 || url.indexOf("?size=") > -1); + let isResized = !config.orignalSizeChecked && (url.indexOf("width=") > -1 || url.indexOf("height=") > -1 || url.indexOf("size=") > -1); url = isResized ? this.removeSizeInUrl(url) : url; - let isFormatted = (url.indexOf("?format=") > -1); + let isFormatted = (url.indexOf("format=") > -1); url = isFormatted ? this.removeFormatInUrl(url) : url; url = url.indexOf("discordapp.com/avatars/") > 0 || url.indexOf("discordapp.com/icons/") > 0 ? `${url}?size=4096` : url; BDFDB.LibraryRequires.request(url, {toBuffer: true}, (error, response, buffer) => {