respect image orientation before saving height and width of FileInfo (#8710)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
14b65b990c
Коммит
5000eac24f
@@ -361,6 +361,14 @@ func (a *App) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if orientation, err := getImageOrientation(bytes.NewReader(data)); err == nil &&
|
||||||
|
(orientation == RotatedCWMirrored ||
|
||||||
|
orientation == RotatedCCW ||
|
||||||
|
orientation == RotatedCCWMirrored ||
|
||||||
|
orientation == RotatedCW) {
|
||||||
|
info.Width, info.Height = info.Height, info.Width
|
||||||
|
}
|
||||||
|
|
||||||
info.Id = model.NewId()
|
info.Id = model.NewId()
|
||||||
info.CreatorId = userId
|
info.CreatorId = userId
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user