mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Resize webp stickers if they're not 1:1
This commit is contained in:
parent
24f7f353e4
commit
11abac2214
1 changed files with 1 additions and 1 deletions
|
@ -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
|
// Allowed mime types from https://developers.facebook.com/docs/whatsapp/on-premises/reference/media
|
||||||
switch {
|
switch {
|
||||||
case isSticker:
|
case isSticker:
|
||||||
if mimeType != "image/webp" {
|
if mimeType != "image/webp" || content.Info.Width != content.Info.Height {
|
||||||
data, convertErr = portal.convertToWebP(data)
|
data, convertErr = portal.convertToWebP(data)
|
||||||
content.Info.MimeType = "image/webp"
|
content.Info.MimeType = "image/webp"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue