FixImageQuality: fix webps not animating in chat
This commit is contained in:
parent
e70747ce39
commit
799ecc38dd
1 changed files with 4 additions and 5 deletions
|
|
@ -74,11 +74,10 @@ export default definePlugin({
|
|||
const url = new URL(src);
|
||||
if (!url.pathname.startsWith("/attachments/")) return;
|
||||
|
||||
if (freeze) {
|
||||
url.searchParams.set("animated", "false");
|
||||
|
||||
if (url.pathname.endsWith(".gif"))
|
||||
url.searchParams.set("format", "webp");
|
||||
url.searchParams.set("animated", String(!freeze));
|
||||
if (freeze && url.pathname.endsWith(".gif")) {
|
||||
// gifs don't support animated=false, so we have no choice but to use webp
|
||||
url.searchParams.set("format", "webp");
|
||||
}
|
||||
|
||||
const isModal = !!trigger;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue