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