MM-49395: Increase compression for previews and emojis (#21985)

We also reduce the max size of uploaded emojis to 512KiB.

https://mattermost.atlassian.net/browse/MM-49395

```release-note
Max size of uploaded emojis is now reduced to 512KiB
to reduce image download bandwidth.
```
Этот коммит содержится в:
Agniva De Sarker
2023-01-05 19:34:22 +05:30
коммит произвёл GitHub
родитель 1078292ac6
Коммит a83170e753
14 изменённых файлов: 12 добавлений и 8 удалений

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

@@ -160,7 +160,10 @@ func createProfileImage(username string, userID string, initialFont string) ([]b
buf := new(bytes.Buffer)
if imgErr := png.Encode(buf, dstImg); imgErr != nil {
enc := png.Encoder{
CompressionLevel: png.BestCompression,
}
if imgErr := enc.Encode(buf, dstImg); imgErr != nil {
return nil, ImageEncodingError
}