Scale, not crop, thumbnails for Telegram stickers

Fixes https://github.com/turt2live/matrix-dimension/issues/250
This commit is contained in:
Travis Ralston 2019-03-17 14:25:35 -06:00 committed by GitHub
parent 70c5471df7
commit 2ff5fa404c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,7 @@ export class AdminStickerService {
const mxc = await mx.upload(png, "image/png");
const serverName = mxc.substring("mxc://".length).split("/")[0];
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({
packId: pack.id,
@ -120,4 +120,4 @@ export class AdminStickerService {
Cache.for(CACHE_STICKERS).clear();
return DimensionStickerService.packToMemory(pack);
}
}
}