[MM-8421] Special PR to have parseImages return nil when format is tiff (#10928)

Этот коммит содержится в:
Angela Chang
2019-05-27 13:20:10 -07:00
коммит произвёл Hanzei
родитель 674b6f2285
Коммит 8e6a158449
2 изменённых файлов: 6 добавлений и 5 удалений

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

@@ -517,5 +517,10 @@ func parseImages(body io.Reader) (*model.PostImage, error) {
image.FrameCount = frameCount
}
// Make image information nil when the format is tiff
if format == "tiff" {
image = nil
}
return image, nil
}

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

@@ -1995,11 +1995,7 @@ func TestParseImages(t *testing.T) {
},
"tiff": {
FileName: "test.tiff",
Expected: &model.PostImage{
Width: 701,
Height: 701,
Format: "tiff",
},
Expected: (*model.PostImage)(nil),
},
"not an image": {
FileName: "README.md",