diff options
author | Wim <wim@42.be> | 2019-02-27 00:41:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 00:41:50 +0100 |
commit | 26a7e35f2777b8424477eef1838125a6ae55fe48 (patch) | |
tree | d48cfdb02bb7a6d0558413cbad906f2ec59cb3a2 /bridge/helper/helper_test.go | |
parent | d44d2a5f0014fda12ce78d35e416dffab6b7c04a (diff) | |
download | matterbridge-msglm-26a7e35f2777b8424477eef1838125a6ae55fe48.tar.gz matterbridge-msglm-26a7e35f2777b8424477eef1838125a6ae55fe48.tar.bz2 matterbridge-msglm-26a7e35f2777b8424477eef1838125a6ae55fe48.zip |
Add MediaConvertWebPToPNG option (telegram). (#741)
* 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
Diffstat (limited to 'bridge/helper/helper_test.go')
-rw-r--r-- | bridge/helper/helper_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bridge/helper/helper_test.go b/bridge/helper/helper_test.go index 1770acd9..48f33b10 100644 --- a/bridge/helper/helper_test.go +++ b/bridge/helper/helper_test.go @@ -1,6 +1,8 @@ package helper import ( + "io/ioutil" + "os" "testing" "github.com/stretchr/testify/assert" @@ -103,3 +105,22 @@ func TestGetSubLines(t *testing.T) { assert.Equalf(t, testcase.nonSplitOutput, nonSplitLines, "'%s' testcase should give expected lines without splitting.", testname) } } + +func TestConvertWebPToPNG(t *testing.T) { + if os.Getenv("LOCAL_TEST") == "" { + t.Skip() + } + input, err := ioutil.ReadFile("test.webp") + if err != nil { + t.Fail() + } + d := &input + err = ConvertWebPToPNG(d) + if err != nil { + t.Fail() + } + err = ioutil.WriteFile("test.png", *d, 0644) + if err != nil { + t.Fail() + } +} |