respect image orientation before saving height and width of FileInfo (#8710)

Этот коммит содержится в:
Saturnino Abril
2018-05-04 01:02:22 +08:00
коммит произвёл GitHub
родитель 14b65b990c
Коммит 5000eac24f

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

@@ -361,6 +361,14 @@ func (a *App) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string,
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.CreatorId = userId