fix FixImagesQuality

This commit is contained in:
Vendicated 2025-10-05 21:02:55 +02:00
parent 467da909d6
commit 887911c1d3
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
3 changed files with 7 additions and 5 deletions

View file

@ -46,7 +46,7 @@ export function FullPatchInput({ setFind, setParsedFind, setMatch, setReplacemen
}
if (!replacement.match) throw new Error("No 'replacement.match' field");
if (!replacement.replace) throw new Error("No 'replacement.replace' field");
if (replacement.replace == null) throw new Error("No 'replacement.replace' field");
setFind(find instanceof RegExp ? `/${find.source}/` : find);
setParsedFind(find);

View file

@ -1,3 +1,5 @@
# Fix Images Quality
Prevents images from being loaded as webp, which can cause quality loss
Improves quality of images in chat by forcing png format.
This plugin does not change how others see your images!

View file

@ -9,14 +9,14 @@ import definePlugin from "@utils/types";
export default definePlugin({
name: "FixImagesQuality",
description: "Prevents images from being loaded as webp, which can cause quality loss",
description: "Improves quality of images in chat by forcing png format",
authors: [Devs.Nuckyz],
patches: [
{
find: ".handleImageLoad)",
replacement: {
match: /(?<=null;return )\i\.\i&&\(\i\|\|!\i\.isAnimated.+?:(?=\i&&\(\i="png"\))/,
replace: ""
match: /(?<=\i=)"webp"/,
replace: '"png"'
}
}
]