Explorar o código

Resize webp stickers if they're not 1:1

Tulir Asokan %!s(int64=3) %!d(string=hai) anos
pai
achega
11abac2214
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      portal.go

+ 1 - 1
portal.go

@@ -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"
 		}