Mm-20223 Add webp emoji support (#20283)

* Added webp package into app/emoji.go , also added a test

* fixed import order inside emoji.go

* Ran go mod tidy

* Conversion to png for Webp emojis that must be resized is implemented

* Deleted unused import

* Added reading mechanism for webp instead of creating

* fileutils and filepath are used while reading a webp file during test

* Deleted readtestwebp function and put it in emoji_test as requested

* Added webp image upload test inside api4/file_test.go

* Expect image is changed from false to true

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Barış
2022-06-21 07:38:02 +03:00
коммит произвёл GitHub
родитель 2b8d63b606
Коммит ccab5be6c4
4 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@@ -453,6 +453,17 @@ func TestUploadFiles(t *testing.T) {
expectedImageMiniPreview: []bool{false},
expectedCreatorId: th.BasicUser.Id,
},
// Webp image test
{
title: "Webp image",
names: []string{"testwebp.webp"},
expectImage: true,
expectedImageWidths: []int{128},
expectedImageHeights: []int{256},
expectedImageHasPreview: []bool{true},
expectedCreatorId: th.BasicUser.Id,
expectedImageMiniPreview: []bool{true},
},
// Error cases
{
title: "Error channel_id does not exist",