summaryrefslogtreecommitdiffstats
path: root/api/file.go
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-14 11:48:53 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-14 11:48:53 -0400
commit7ff57181b9aa182a7073a923004d63bbbe100e1d (patch)
tree12f9535800a0b393f55197268b7e2966e861d95c /api/file.go
parent1f1ad8234aa44268ce76d24b80c86f5b009cc5e6 (diff)
downloadchat-7ff57181b9aa182a7073a923004d63bbbe100e1d.tar.gz
chat-7ff57181b9aa182a7073a923004d63bbbe100e1d.tar.bz2
chat-7ff57181b9aa182a7073a923004d63bbbe100e1d.zip
Changed image resizing for both the preview and thumbnail to use Lanczos interpolation instead of simple nearest neighbour
Diffstat (limited to 'api/file.go')
-rw-r--r--api/file.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/file.go b/api/file.go
index 0e08567d6..eaba515a4 100644
--- a/api/file.go
+++ b/api/file.go
@@ -13,9 +13,9 @@ import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
"github.com/nfnt/resize"
+ _ "golang.org/x/image/bmp"
"image"
_ "image/gif"
- _ "golang.org/x/image/bmp"
"image/jpeg"
"io"
"net/http"
@@ -157,7 +157,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch
go func() {
var thumbnail image.Image
if imgConfig.Width > int(utils.Cfg.ImageSettings.ThumbnailWidth) {
- thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.NearestNeighbor)
+ thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.Lanczos3)
} else {
thumbnail = img
}
@@ -182,7 +182,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch
go func() {
var preview image.Image
if imgConfig.Width > int(utils.Cfg.ImageSettings.PreviewWidth) {
- preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.NearestNeighbor)
+ preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.Lanczos3)
} else {
preview = img
}