mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
Scale, not crop, thumbnails for Telegram stickers
Fixes https://github.com/turt2live/matrix-dimension/issues/250
This commit is contained in:
parent
70c5471df7
commit
2ff5fa404c
@ -86,7 +86,7 @@ export class AdminStickerService {
|
|||||||
const mxc = await mx.upload(png, "image/png");
|
const mxc = await mx.upload(png, "image/png");
|
||||||
const serverName = mxc.substring("mxc://".length).split("/")[0];
|
const serverName = mxc.substring("mxc://".length).split("/")[0];
|
||||||
const contentId = mxc.substring("mxc://".length).split("/")[1];
|
const contentId = mxc.substring("mxc://".length).split("/")[1];
|
||||||
const thumbMxc = await mx.uploadFromUrl(await mx.getThumbnailUrl(serverName, contentId, 512, 512, "crop", false), "image/png");
|
const thumbMxc = await mx.uploadFromUrl(await mx.getThumbnailUrl(serverName, contentId, 512, 512, "scale", false), "image/png");
|
||||||
|
|
||||||
stickers.push(await Sticker.create({
|
stickers.push(await Sticker.create({
|
||||||
packId: pack.id,
|
packId: pack.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user