[MM-61477] Fixed exif rotates images width and height is not correctly calculated (#29309)
* [MM-61477] Fixed exif rotates images width and height is not correctly calculated * [MM-61477] Apply rotation ony to png or jepg * [MM-61477] Added test cases to verify correct rotation * fix: fixed wrong format * uff * fix: exif rotation is only possible on jpeg images --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -2756,6 +2756,70 @@ func TestParseImages(t *testing.T) {
|
||||
Format: "png",
|
||||
},
|
||||
},
|
||||
"jpg-1": {
|
||||
FileName: "orientation_test_1.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"jpg-2": {
|
||||
FileName: "orientation_test_2.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"jpg-3": {
|
||||
FileName: "orientation_test_3.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"jpg-4": {
|
||||
FileName: "orientation_test_4.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"jpg-5": {
|
||||
FileName: "orientation_test_5.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"jpg-6": {
|
||||
FileName: "orientation_test_6.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"jpg-7": {
|
||||
FileName: "orientation_test_7.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"jpg-8": {
|
||||
FileName: "orientation_test_8.jpeg",
|
||||
Expected: &model.PostImage{
|
||||
Width: 2860,
|
||||
Height: 1578,
|
||||
Format: "jpeg",
|
||||
},
|
||||
},
|
||||
"animated gif": {
|
||||
FileName: "testgif.gif",
|
||||
Expected: &model.PostImage{
|
||||
|
||||
Ссылка в новой задаче
Block a user