From c336804c7e82bc703f4c90c5b7e50bc4b36a5f57 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 4 Feb 2023 16:17:17 +0200 Subject: [PATCH] Fix sticker sizes --- example-config.yaml | 4 ++-- portal.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/example-config.yaml b/example-config.yaml index 6ff48f1..e783b5e 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -151,8 +151,8 @@ bridge: target: webp # Arguments for converter. All converters take width and height. args: - width: 256 - height: 256 + width: 320 + height: 320 fps: 25 # only for webm, webp and gif (2, 5, 10, 20 or 25 recommended) # Servers to always allow double puppeting from double_puppet_server_map: diff --git a/portal.go b/portal.go index d59b19e..2eb268b 100644 --- a/portal.go +++ b/portal.go @@ -578,6 +578,10 @@ func (portal *Portal) handleDiscordFile(typeName string, intent *appservice.Inte content.Info.Width = dbFile.Width content.Info.Height = dbFile.Height } + if content.Info.Width == 0 && content.Info.Height == 0 && typeName == "sticker" { + content.Info.Width = DiscordStickerSize + content.Info.Height = DiscordStickerSize + } if dbFile.DecryptionInfo != nil { content.File = &event.EncryptedFileInfo{ EncryptedFile: *dbFile.DecryptionInfo,