Resize webp stickers if they're not 1:1

This commit is contained in:
Tulir Asokan 2022-08-25 11:43:16 +03:00
parent 24f7f353e4
commit 11abac2214

View file

@ -2902,7 +2902,7 @@ func (portal *Portal) preprocessMatrixMedia(ctx context.Context, sender *User, r
// Allowed mime types from https://developers.facebook.com/docs/whatsapp/on-premises/reference/media
switch {
case isSticker:
if mimeType != "image/webp" {
if mimeType != "image/webp" || content.Info.Width != content.Info.Height {
data, convertErr = portal.convertToWebP(data)
content.Info.MimeType = "image/webp"
}