fix FixImagesQuality
This commit is contained in:
parent
467da909d6
commit
887911c1d3
3 changed files with 7 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
|
|
|
|||
|
|
@ -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"'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue