[MM-8421] Special PR to have parseImages return nil when format is tiff (#10928)
Этот коммит содержится в:
коммит произвёл
Hanzei
родитель
674b6f2285
Коммит
8e6a158449
@@ -517,5 +517,10 @@ func parseImages(body io.Reader) (*model.PostImage, error) {
|
|||||||
image.FrameCount = frameCount
|
image.FrameCount = frameCount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make image information nil when the format is tiff
|
||||||
|
if format == "tiff" {
|
||||||
|
image = nil
|
||||||
|
}
|
||||||
|
|
||||||
return image, nil
|
return image, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1995,11 +1995,7 @@ func TestParseImages(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"tiff": {
|
"tiff": {
|
||||||
FileName: "test.tiff",
|
FileName: "test.tiff",
|
||||||
Expected: &model.PostImage{
|
Expected: (*model.PostImage)(nil),
|
||||||
Width: 701,
|
|
||||||
Height: 701,
|
|
||||||
Format: "tiff",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
"not an image": {
|
"not an image": {
|
||||||
FileName: "README.md",
|
FileName: "README.md",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user