PLT-616: Enable playing of animated GIF in thumbnails and preview

Этот коммит содержится в:
Florian Orben
2015-10-17 01:58:34 +02:00
родитель 9553e44dc5
Коммит d167e18f00
6 изменённых файлов: 161 добавлений и 4 удалений

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

@@ -23,6 +23,7 @@ import (
"image/jpeg"
"io"
"io/ioutil"
"mime"
"net/http"
"net/url"
"os"
@@ -331,9 +332,18 @@ func getFileInfo(c *Context, w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "max-age=2592000, public")
var mimeType string
ext := filepath.Ext(filename)
if model.IsFileExtImage(ext) {
mimeType = model.GetImageMimeType(ext)
} else {
mimeType = mime.TypeByExtension(ext)
}
result := make(map[string]string)
result["filename"] = filename
result["size"] = size
result["mime"] = mimeType
w.Write([]byte(model.MapToJson(result)))
}