From 4ea7f6a2f7e61356996a3dfa85169f8db5d4d064 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Tue, 12 Jun 2018 10:48:45 +0100 Subject: MM-10791: Don't try and generate thumbnails for non-images/svgs. (#8937) --- app/import.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app/import.go') diff --git a/app/import.go b/app/import.go index 8075497a0..5364b1026 100644 --- a/app/import.go +++ b/app/import.go @@ -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 -- cgit v1.2.3-1-g7c22