diff options
Diffstat (limited to 'bridge/telegram')
-rw-r--r-- | bridge/telegram/handlers.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index e87466ca..93576fb4 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -245,6 +245,15 @@ func (b *Btelegram) handleDownload(rmsg *config.Message, message *tgbotapi.Messa if err != nil { return err } + if strings.HasSuffix(name, ".webp") && b.GetBool("MediaConvertWebPToPNG") { + b.Log.Debugf("WebP to PNG conversion enabled, converting %s", name) + err := helper.ConvertWebPToPNG(data) + if err != nil { + b.Log.Errorf("conversion failed: %s", err) + } else { + name = strings.Replace(name, ".webp", ".png", 1) + } + } helper.HandleDownloadData(b.Log, rmsg, name, message.Caption, "", data, b.General) return nil } |