mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
Improved size of animated images
This commit is contained in:
parent
d89bfd2f22
commit
87cecc9540
@ -141,13 +141,13 @@ class _MatrixStickerBot {
|
|||||||
thumbUpload = imageUpload;
|
thumbUpload = imageUpload;
|
||||||
}
|
}
|
||||||
if (mime === "image/gif" || mime === "image/webp" || mime === "image/avif-sequence") {
|
if (mime === "image/gif" || mime === "image/webp" || mime === "image/avif-sequence") {
|
||||||
imageUpload = await resizedImage.webp({nearLossless: true, quality: 60}).toBuffer();
|
imageUpload = await resizedImage.webp({quality: 60, effort: 6}).toBuffer();
|
||||||
thumbUpload = await sharp(downImage, {animated: false}).resize({
|
thumbUpload = await sharp(downImage, {animated: false}).resize({
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
fit: 'contain',
|
fit: 'contain',
|
||||||
background: 'rgba(0,0,0,0)',
|
background: 'rgba(0,0,0,0)',
|
||||||
}).webp({quality: 60}).toBuffer();
|
}).webp({quality: 50}).toBuffer();
|
||||||
mime = "image/webp";
|
mime = "image/webp";
|
||||||
}
|
}
|
||||||
if (mime === "image/avif") {
|
if (mime === "image/avif") {
|
||||||
|
Loading…
Reference in New Issue
Block a user