MM-10791: Don't try and generate thumbnails for non-images/svgs. (#8937)

Этот коммит содержится в:
George Goldberg
2018-06-12 10:48:45 +01:00
коммит произвёл GitHub
родитель 9517cccab0
Коммит 4ea7f6a2f7

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

@@ -1699,11 +1699,13 @@ func (a *App) OldImportFile(timestamp time.Time, file io.Reader, teamId string,
return nil, err return nil, err
} }
if fileInfo.IsImage() && fileInfo.MimeType != "image/svg+xml" {
img, width, height := prepareImage(data) img, width, height := prepareImage(data)
if img != nil { if img != nil {
a.generateThumbnailImage(*img, fileInfo.ThumbnailPath, width, height) a.generateThumbnailImage(*img, fileInfo.ThumbnailPath, width, height)
a.generatePreviewImage(*img, fileInfo.PreviewPath, width) a.generatePreviewImage(*img, fileInfo.PreviewPath, width)
} }
}
return fileInfo, nil return fileInfo, nil
} }