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

This commit is contained in:
George Goldberg
2018-06-12 10:48:45 +01:00
committed by GitHub
parent 9517cccab0
commit 4ea7f6a2f7

View File

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