From 416d85dcf096d4265abbe2aa9e89ead74d3e72ab Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:20:06 -0300 Subject: [PATCH] new plugin FixImagesQuality --- src/plugins/fixImagesQuality/README.md | 3 +++ src/plugins/fixImagesQuality/index.ts | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/plugins/fixImagesQuality/README.md create mode 100644 src/plugins/fixImagesQuality/index.ts diff --git a/src/plugins/fixImagesQuality/README.md b/src/plugins/fixImagesQuality/README.md new file mode 100644 index 000000000..8e3cf6548 --- /dev/null +++ b/src/plugins/fixImagesQuality/README.md @@ -0,0 +1,3 @@ +# Fix Images Quality + +Prevents images from being loaded as webp, which can cause quality loss diff --git a/src/plugins/fixImagesQuality/index.ts b/src/plugins/fixImagesQuality/index.ts new file mode 100644 index 000000000..8f84573c0 --- /dev/null +++ b/src/plugins/fixImagesQuality/index.ts @@ -0,0 +1,23 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { Devs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "FixImagesQuality", + description: "Prevents images from being loaded as webp, which can cause quality loss", + authors: [Devs.Nuckyz], + patches: [ + { + find: "getFormatQuality(){", + replacement: { + match: /(?<=null;return )\i\.\i&&\(\i\|\|!\i\.isAnimated.+?:(?=\i&&\(\i="png"\))/, + replace: "" + } + } + ] +});