Add MediaConvertWebPToPNG option (telegram).

When enabled matterbridge will convert .webp files to .png files
before uploading them to the mediaserver of the other bridges.

Fixes #398
This commit is contained in:
Wim
2019-02-26 20:15:22 +01:00
parent 7f1d86b338
commit 948e8e2ad2
27 changed files with 4312 additions and 0 deletions

View File

@@ -245,6 +245,12 @@ func (b *Btelegram) handleDownload(rmsg *config.Message, message *tgbotapi.Messa
if err != nil {
return err
}
if strings.HasSuffix(name, ".webp") && b.GetBool("MediaConvertWebPToPNG") {
if err := helper.ConvertWebPToPNG(data); err == nil {
name = strings.Replace(name, ".webp", ".png", 1)
//name=strings.Replace
}
}
helper.HandleDownloadData(b.Log, rmsg, name, message.Caption, "", data, b.General)
return nil
}