Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Importing telegram stickers with aspect ratio not equal 1:1 #251

Closed
inexcode opened this issue Mar 17, 2019 · 0 comments
Closed

Importing telegram stickers with aspect ratio not equal 1:1 #251

inexcode opened this issue Mar 17, 2019 · 0 comments
Labels
Milestone

Comments

@inexcode
Copy link

Stickers on Telegram may have one side smaller than 512.
With #250 fixed thumbnails are created correctly now, 512x266 for example, but metadata is incorrect now.

thumbnailWidth: 512,
thumbnailHeight: 512,

Riot for web squeezes stickers with non 1:1 ratio, Riot for Android crops them.
One side is always 512, while another can be anywhere smaller.

I think, the easiest fix is to use one more sharp library method, something like that:

const png = await sharp(buffer).resize({ width: 512, height: 512, fit: 'contain' }).png().toBuffer();

Please note: I didn't test if this works.

@turt2live turt2live added the bug label Mar 17, 2019
@turt2live turt2live added this to the v1.0.0 milestone Mar 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants